1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
DROP TABLE IF EXISTS t1;
set session tokudb_disable_slow_alter=ON;
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16)
, PRIMARY KEY (sca_code, cat_code, lan_code)
) Engine = tokudb ;
INSERT INTO t1 ( sca_code, cat_code, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES
( 'PD', 'J', 'EN', NULL, NULL, 'PENDANT'),
( 'RI', 'J', 'EN', NULL, NULL, 'RING'),
( 'QQ', 'N', 'EN', 'not null', NULL, 'RING');
alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
ERROR 42000: Table 't1' uses an extension that doesn't exist in this XYZ version
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
DROP TABLE t1;
DROP TABLE t1;
ERROR 42S02: Unknown table 'test.t1'
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
sca_desc varchar(50),
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16),
PRIMARY KEY (sca_code, cat_code, lan_code),
INDEX sca_pic (sca_pic)
) Engine = tokudb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'
),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
select count(*) from t1 where sca_code = 'PD';
count(*)
1
select count(*) from t1 where sca_code <= 'PD';
count(*)
1
select count(*) from t1 where sca_pic is null;
count(*)
2
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
ERROR 42000: Table 't1' uses an extension that doesn't exist in this XYZ version
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where cat_code='E';
count(*)
0
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
ERROR 42000: Table 't1' uses an extension that doesn't exist in this XYZ version
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
select sca_pic from t1 where sca_pic is null;
sca_pic
NULL
NULL
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
DROP TABLE t1;
|