mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
branches/zip: innodb-index.test: Make the column b much longer, to hit
the 65,535-byte VARCHAR length limit of MySQL.
This commit is contained in:
parent
21d303fed2
commit
62ede4fcd4
2 changed files with 34 additions and 30 deletions
|
@ -1012,21 +1012,21 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a int, b blob, c text, d text not null) engine=innodb default charset = utf8;
|
create table t1(a int, b blob, c text, d text not null) engine=innodb default charset = utf8;
|
||||||
insert into t1 values (22,repeat('jejdkrun87',220),repeat('jejdkrun87',440),'jejdkrun87');
|
insert into t1 values (22,repeat('jejdkrun87',2200),repeat('jejdkrun87',440),'jejdkrun87');
|
||||||
insert into t1 values (44,repeat('adfd72nh9k',440),repeat('adfd72nh9k',880),'adfd72nh9k');
|
insert into t1 values (44,repeat('adfd72nh9k',4400),repeat('adfd72nh9k',880),'adfd72nh9k');
|
||||||
insert into t1 values (null,null,null,'null');
|
insert into t1 values (null,null,null,'null');
|
||||||
select count(*) from t1 where a=44;
|
select count(*) from t1 where a=44;
|
||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
a b=repeat(d,10*a) c=repeat(d,20*a)
|
a b=repeat(d,100*a) c=repeat(d,20*a)
|
||||||
22 1 1
|
22 1 1
|
||||||
44 1 1
|
44 1 1
|
||||||
NULL NULL NULL
|
NULL NULL NULL
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
a length(b) length(c) d
|
a length(b) length(c) d
|
||||||
22 2200 4400 jejdkrun87
|
22 22000 4400 jejdkrun87
|
||||||
44 4400 8800 adfd72nh9k
|
44 44000 8800 adfd72nh9k
|
||||||
NULL NULL NULL null
|
NULL NULL NULL null
|
||||||
alter table t1 add primary key (a), add key (b(20));
|
alter table t1 add primary key (a), add key (b(20));
|
||||||
ERROR 42000: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
|
ERROR 42000: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
|
||||||
|
@ -1035,17 +1035,21 @@ alter table t1 add primary key (a), add key (b(20));
|
||||||
select count(*) from t1 where a=44;
|
select count(*) from t1 where a=44;
|
||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
a b=repeat(d,10*a) c=repeat(d,20*a)
|
a b=repeat(d,100*a) c=repeat(d,20*a)
|
||||||
22 1 1
|
22 1 1
|
||||||
44 1 1
|
44 1 1
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
a length(b) length(c) d
|
a length(b) length(c) d
|
||||||
22 2200 4400 jejdkrun87
|
22 22000 4400 jejdkrun87
|
||||||
44 4400 8800 adfd72nh9k
|
44 44000 8800 adfd72nh9k
|
||||||
insert into t1 values (33,repeat('adfdpplkeock',330),repeat('adfdpplkeock',660),'adfdpplkeock');
|
insert into t1 values (33,repeat('adfdpplkeock',3300),repeat('adfdpplkeock',660),'adfdpplkeock');
|
||||||
insert into t1 values (55,repeat('adfdijnmnb78k',550),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
|
insert into t1 values (55,repeat('adfdijnmnb78k',5500),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
|
||||||
insert into t1 values (66,repeat('adfdijn0loKNHJik',660),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'b' at row 1
|
||||||
|
insert into t1 values (66,repeat('adfdijn0loKNHJik',6600),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'b' at row 1
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
|
@ -1062,18 +1066,18 @@ test.t1 check status OK
|
||||||
explain select * from t1 where b like 'adfd%';
|
explain select * from t1 where b like 'adfd%';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 range b b 23 NULL 2 Using where
|
1 SIMPLE t1 range b b 23 NULL 2 Using where
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
a b=repeat(d,10*a) c=repeat(d,20*a)
|
a b=repeat(d,100*a) c=repeat(d,20*a)
|
||||||
22 1 1
|
22 1 1
|
||||||
33 1 1
|
33 1 1
|
||||||
44 1 1
|
44 1 1
|
||||||
55 1 1
|
55 0 1
|
||||||
66 1 1
|
66 0 1
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
a length(b) length(c) d
|
a length(b) length(c) d
|
||||||
22 2200 4400 jejdkrun87
|
22 22000 4400 jejdkrun87
|
||||||
33 3960 7920 adfdpplkeock
|
33 39600 7920 adfdpplkeock
|
||||||
44 4400 8800 adfd72nh9k
|
44 44000 8800 adfd72nh9k
|
||||||
55 7150 14300 adfdijnmnb78k
|
55 65535 14300 adfdijnmnb78k
|
||||||
66 10560 21120 adfdijn0loKNHJik
|
66 65535 21120 adfdijn0loKNHJik
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
|
@ -307,26 +307,26 @@ explain select * from t1 order by a;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1(a int, b blob, c text, d text not null) engine=innodb default charset = utf8;
|
create table t1(a int, b blob, c text, d text not null) engine=innodb default charset = utf8;
|
||||||
insert into t1 values (22,repeat('jejdkrun87',220),repeat('jejdkrun87',440),'jejdkrun87');
|
insert into t1 values (22,repeat('jejdkrun87',2200),repeat('jejdkrun87',440),'jejdkrun87');
|
||||||
insert into t1 values (44,repeat('adfd72nh9k',440),repeat('adfd72nh9k',880),'adfd72nh9k');
|
insert into t1 values (44,repeat('adfd72nh9k',4400),repeat('adfd72nh9k',880),'adfd72nh9k');
|
||||||
insert into t1 values (null,null,null,'null');
|
insert into t1 values (null,null,null,'null');
|
||||||
|
|
||||||
select count(*) from t1 where a=44;
|
select count(*) from t1 where a=44;
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
--error ER_PRIMARY_CANT_HAVE_NULL
|
--error ER_PRIMARY_CANT_HAVE_NULL
|
||||||
alter table t1 add primary key (a), add key (b(20));
|
alter table t1 add primary key (a), add key (b(20));
|
||||||
delete from t1 where d='null';
|
delete from t1 where d='null';
|
||||||
alter table t1 add primary key (a), add key (b(20));
|
alter table t1 add primary key (a), add key (b(20));
|
||||||
select count(*) from t1 where a=44;
|
select count(*) from t1 where a=44;
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
insert into t1 values (33,repeat('adfdpplkeock',330),repeat('adfdpplkeock',660),'adfdpplkeock');
|
insert into t1 values (33,repeat('adfdpplkeock',3300),repeat('adfdpplkeock',660),'adfdpplkeock');
|
||||||
insert into t1 values (55,repeat('adfdijnmnb78k',550),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
|
insert into t1 values (55,repeat('adfdijnmnb78k',5500),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
|
||||||
insert into t1 values (66,repeat('adfdijn0loKNHJik',660),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
|
insert into t1 values (66,repeat('adfdijn0loKNHJik',6600),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
|
||||||
show create table t1;
|
show create table t1;
|
||||||
check table t1;
|
check table t1;
|
||||||
explain select * from t1 where b like 'adfd%';
|
explain select * from t1 where b like 'adfd%';
|
||||||
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
|
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
|
||||||
select a,length(b),length(c),d from t1;
|
select a,length(b),length(c),d from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
Loading…
Reference in a new issue