Commit 4e44c733 authored by marko's avatar marko

branches/zip: innodb-index.test: Work around MySQL bugs and bug fixes.

parent 97f96fb6
...@@ -848,24 +848,28 @@ test.t1 check status OK ...@@ -848,24 +848,28 @@ 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 769 NULL 11 Using where 1 SIMPLE t1 range b b 769 NULL 11 Using where
create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
insert into t2 select a,left(b,255) from t1;
drop table t1;
rename table t2 to t1;
begin; begin;
select a from t1 limit 1 for update; select a from t1 limit 1 for update;
a a
22 22
create index t1ba on t1 (b(10),a); create index t1ba on t1 (b,a);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit; commit;
begin; begin;
select a from t1 limit 1 lock in share mode; select a from t1 limit 1 lock in share mode;
a a
22 22
create index t1ba on t1 (b(10),a); create index t1ba on t1 (b,a);
drop index t1ba on t1; drop index t1ba on t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit; commit;
explain select a from t1 order by b; explain select a from t1 order by b;
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 index NULL t1ba 16 NULL 60 Using index; Using filesort 1 SIMPLE t1 index NULL t1ba 261 NULL 15 Using index
select a,sleep(2+a/100) from t1 order by b limit 3; select a,sleep(2+a/100) from t1 order by b limit 3;
select sleep(1); select sleep(1);
sleep(1) sleep(1)
...@@ -877,12 +881,12 @@ a sleep(2+a/100) ...@@ -877,12 +881,12 @@ a sleep(2+a/100)
66 0 66 0
explain select a from t1 order by b; explain select a from t1 order by b;
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 index NULL PRIMARY 1028 NULL 60 Using index; Using filesort 1 SIMPLE t1 index NULL PRIMARY 261 NULL 15 Using index; Using filesort
select a from t1 order by b limit 3; select a from t1 order by b limit 3;
a a
22 22
44
66 66
44
commit; commit;
drop table t1; drop table t1;
create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob, create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
......
...@@ -264,6 +264,12 @@ explain select * from t1 where b like 'adfd%'; ...@@ -264,6 +264,12 @@ explain select * from t1 where b like 'adfd%';
# #
# Test locking # Test locking
# #
create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
insert into t2 select a,left(b,255) from t1;
drop table t1;
rename table t2 to t1;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
...@@ -273,7 +279,7 @@ select a from t1 limit 1 for update; ...@@ -273,7 +279,7 @@ select a from t1 limit 1 for update;
connection b; connection b;
# This would require an S lock on the table, conflicting with the IX lock. # This would require an S lock on the table, conflicting with the IX lock.
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT
create index t1ba on t1 (b(10),a); create index t1ba on t1 (b,a);
connection a; connection a;
commit; commit;
begin; begin;
...@@ -281,7 +287,7 @@ begin; ...@@ -281,7 +287,7 @@ begin;
select a from t1 limit 1 lock in share mode; select a from t1 limit 1 lock in share mode;
connection b; connection b;
# This will require an S lock on the table. No conflict with the IS lock. # This will require an S lock on the table. No conflict with the IS lock.
create index t1ba on t1 (b(10),a); create index t1ba on t1 (b,a);
# This would require an X lock on the table, conflicting with the IS lock. # This would require an X lock on the table, conflicting with the IS lock.
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT
drop index t1ba on t1; drop index t1ba on t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment