Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8763d941
Commit
8763d941
authored
Sep 17, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: innodb-index.test: Make the column b much longer, to hit
the 65,535-byte VARCHAR length limit of MySQL.
parent
1fabfe9c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
30 deletions
+34
-30
mysql-test/innodb-index.result
mysql-test/innodb-index.result
+26
-22
mysql-test/innodb-index.test
mysql-test/innodb-index.test
+8
-8
No files found.
mysql-test/innodb-index.result
View file @
8763d941
...
...
@@ -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
drop table t1;
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 (44,repeat('adfd72nh9k',440),repeat('adfd72nh9k',880),'adfd72nh9k');
insert into t1 values (22,repeat('jejdkrun87',220
0
),repeat('jejdkrun87',440),'jejdkrun87');
insert into t1 values (44,repeat('adfd72nh9k',440
0
),repeat('adfd72nh9k',880),'adfd72nh9k');
insert into t1 values (null,null,null,'null');
select count(*) from t1 where a=44;
count(*)
1
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10*a) c=repeat(d,20*a)
select a,b=repeat(d,10
0
*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10
0
*a) c=repeat(d,20*a)
22 1 1
44 1 1
NULL NULL NULL
select a,length(b),length(c),d from t1;
a length(b) length(c) d
22 2200 4400 jejdkrun87
44 4400 8800 adfd72nh9k
22 2200
0
4400 jejdkrun87
44 4400
0
8800 adfd72nh9k
NULL NULL NULL null
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
...
...
@@ -1035,17 +1035,21 @@ alter table t1 add primary key (a), add key (b(20));
select count(*) from t1 where a=44;
count(*)
1
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10*a) c=repeat(d,20*a)
select a,b=repeat(d,10
0
*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10
0
*a) c=repeat(d,20*a)
22 1 1
44 1 1
select a,length(b),length(c),d from t1;
a length(b) length(c) d
22 2200 4400 jejdkrun87
44 4400 8800 adfd72nh9k
insert into t1 values (33,repeat('adfdpplkeock',330),repeat('adfdpplkeock',660),'adfdpplkeock');
insert into t1 values (55,repeat('adfdijnmnb78k',550),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
insert into t1 values (66,repeat('adfdijn0loKNHJik',660),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
22 22000 4400 jejdkrun87
44 44000 8800 adfd72nh9k
insert into t1 values (33,repeat('adfdpplkeock',3300),repeat('adfdpplkeock',660),'adfdpplkeock');
insert into t1 values (55,repeat('adfdijnmnb78k',5500),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
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;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -1062,18 +1066,18 @@ test.t1 check status OK
explain select * from t1 where b like 'adfd%';
id select_type table type possible_keys key key_len ref rows Extra
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;
a b=repeat(d,10*a) c=repeat(d,20*a)
select a,b=repeat(d,10
0
*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10
0
*a) c=repeat(d,20*a)
22 1 1
33 1 1
44 1 1
55
1
1
66
1
1
55
0
1
66
0
1
select a,length(b),length(c),d from t1;
a length(b) length(c) d
22 2200 4400 jejdkrun87
33 3960 7920 adfdpplkeock
44 4400 8800 adfd72nh9k
55
7150
14300 adfdijnmnb78k
66
10560
21120 adfdijn0loKNHJik
22 2200
0
4400 jejdkrun87
33 3960
0
7920 adfdpplkeock
44 4400
0
8800 adfd72nh9k
55
65535
14300 adfdijnmnb78k
66
65535
21120 adfdijn0loKNHJik
drop table t1;
mysql-test/innodb-index.test
View file @
8763d941
...
...
@@ -307,26 +307,26 @@ explain select * from t1 order by a;
drop
table
t1
;
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
(
44
,
repeat
(
'adfd72nh9k'
,
440
),
repeat
(
'adfd72nh9k'
,
880
),
'adfd72nh9k'
);
insert
into
t1
values
(
22
,
repeat
(
'jejdkrun87'
,
220
0
),
repeat
(
'jejdkrun87'
,
440
),
'jejdkrun87'
);
insert
into
t1
values
(
44
,
repeat
(
'adfd72nh9k'
,
440
0
),
repeat
(
'adfd72nh9k'
,
880
),
'adfd72nh9k'
);
insert
into
t1
values
(
null
,
null
,
null
,
'null'
);
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
,
10
0
*
a
),
c
=
repeat
(
d
,
20
*
a
)
from
t1
;
select
a
,
length
(
b
),
length
(
c
),
d
from
t1
;
--
error
ER_PRIMARY_CANT_HAVE_NULL
alter
table
t1
add
primary
key
(
a
),
add
key
(
b
(
20
));
delete
from
t1
where
d
=
'null'
;
alter
table
t1
add
primary
key
(
a
),
add
key
(
b
(
20
));
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
,
10
0
*
a
),
c
=
repeat
(
d
,
20
*
a
)
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
(
55
,
repeat
(
'adfdijnmnb78k'
,
550
),
repeat
(
'adfdijnmnb78k'
,
1100
),
'adfdijnmnb78k'
);
insert
into
t1
values
(
66
,
repeat
(
'adfdijn0loKNHJik'
,
660
),
repeat
(
'adfdijn0loKNHJik'
,
1320
),
'adfdijn0loKNHJik'
);
insert
into
t1
values
(
33
,
repeat
(
'adfdpplkeock'
,
330
0
),
repeat
(
'adfdpplkeock'
,
660
),
'adfdpplkeock'
);
insert
into
t1
values
(
55
,
repeat
(
'adfdijnmnb78k'
,
550
0
),
repeat
(
'adfdijnmnb78k'
,
1100
),
'adfdijnmnb78k'
);
insert
into
t1
values
(
66
,
repeat
(
'adfdijn0loKNHJik'
,
660
0
),
repeat
(
'adfdijn0loKNHJik'
,
1320
),
'adfdijn0loKNHJik'
);
show
create
table
t1
;
check
table
t1
;
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
,
10
0
*
a
),
c
=
repeat
(
d
,
20
*
a
)
from
t1
;
select
a
,
length
(
b
),
length
(
c
),
d
from
t1
;
drop
table
t1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment