From 306942c94ca1ba61f2fe017cd310f07f260b6694 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 20 Jun 2004 23:44:21 +0300 Subject: do not clear list of changed tables on one statement rollback (Bug #4213) mysql-test/r/innodb_cache.result: test of rollback one statement in transaction mysql-test/t/innodb_cache.test: test of rollback one statement in transaction sql/handler.cc: clear changed tables list only for total roll back --- mysql-test/r/innodb_cache.result | 21 ++++++++++++++++++++- mysql-test/t/innodb_cache.test | 23 ++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result index 47abcb45fe5..634b9b860c9 100644 --- a/mysql-test/r/innodb_cache.result +++ b/mysql-test/r/innodb_cache.result @@ -98,7 +98,7 @@ commit; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 -drop table if exists t1; +drop table t3,t2,t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB; select count(*) from t1; count(*) @@ -108,3 +108,22 @@ select count(*) from t1; count(*) 1 drop table t1; +set GLOBAL query_cache_size=1355776; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb; +INSERT INTO t1 VALUES (1,'me'); +INSERT INTO t2 VALUES (1,'you'); +INSERT INTO t3 VALUES (2,1,1,2); +delete from t3 where t1_id = 1 and t2_id = 1; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +id a +begin; +insert into t3 VALUES ( NULL, 1, 1, 2 ); +insert into t3 VALUES ( NULL, 1, 1, 2 ); +Duplicate entry '1-1' for key 2 +commit; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +id a +1 me +drop table t3,t2,t1; diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test index 9066a5f19ba..da9fc494d5b 100644 --- a/mysql-test/t/innodb_cache.test +++ b/mysql-test/t/innodb_cache.test @@ -48,10 +48,31 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; commit; show status like "Qcache_queries_in_cache"; +drop table t3,t2,t1; -drop table if exists t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB; select count(*) from t1; insert into t1 (id) values (0); select count(*) from t1; drop table t1; + +# +# one statement roll back inside transation +# +set GLOBAL query_cache_size=1355776; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb; +INSERT INTO t1 VALUES (1,'me'); +INSERT INTO t2 VALUES (1,'you'); +INSERT INTO t3 VALUES (2,1,1,2); +delete from t3 where t1_id = 1 and t2_id = 1; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +begin; +insert into t3 VALUES ( NULL, 1, 1, 2 ); +-- error 1062 +insert into t3 VALUES ( NULL, 1, 1, 2 ); +commit; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +drop table t3,t2,t1; + -- cgit v1.2.1 From 83a4e46d8e6c324ae6f2232a36907a554a3d9dd4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Jun 2004 19:42:00 +0300 Subject: use ref not range for ... WHERE key IN (val) --- mysql-test/r/range.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index b826dd1b677..c930b0df77a 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -255,7 +255,7 @@ t1 ref y y 5 const 1 Using where t2 range x x 5 NULL 2 Using where explain select count(*) from t1 where x in (1); table type possible_keys key key_len ref rows Extra -t1 range x x 5 NULL 1 Using where; Using index +t1 ref x x 5 const 1 Using where; Using index explain select count(*) from t1 where x in (1,2); table type possible_keys key key_len ref rows Extra t1 range x x 5 NULL 2 Using where; Using index -- cgit v1.2.1 From 8f3b8de2727a8200e0780e6aa8c78760c8eaa1d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Jun 2004 17:27:57 +0200 Subject: bug#2688 - Wrong index_merge query results for BDB table with variable length primary key. dded code to clear the tail of the reference buffer if the actual key length is less than the maximum key length. mysql-test/r/bdb.result: bug#2688 - Wrong index_merge query results for BDB table with variable length primary key. Added the test case results. mysql-test/t/bdb.test: bug#2688 - Wrong index_merge query results for BDB table with variable length primary key. Added the test case. sql/ha_berkeley.cc: bug#2688 - Wrong index_merge query results for BDB table with variable length primary key. Added code to clear the tail of the reference buffer if the actual key length is less than the maximum key length. --- mysql-test/r/bdb.result | 18 ++++++++++++++++++ mysql-test/t/bdb.test | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 2ccb5148d58..7d4b42e6a8c 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1190,3 +1190,21 @@ a A a drop table t1; +create table t1 ( +pk1 varchar(8) not null default '', +pk2 varchar(4) not null default '', +key1 int(11) default null, +key2 int(11) default null, +primary key (pk1,pk2), +key key1 (key1), +key key2 (key2)) engine=bdb; +insert into t1 values ('','empt',2,2), ('a','a--a',2,2), +('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2); +select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +pk1 pk2 key1 key2 + empt 2 2 +a a--a 2 2 +bb b--b 2 2 +ccc c--c 2 2 +dddd d--d 2 2 +drop table t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 4b490052535..bed0cbe269d 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -829,3 +829,21 @@ alter table t1 modify a char(10) binary; explain select a from t1; select a from t1; drop table t1; + +# +# bug#2688 - Wrong index_merge query results for BDB table with variable length primary key +# + +create table t1 ( + pk1 varchar(8) not null default '', + pk2 varchar(4) not null default '', + key1 int(11) default null, + key2 int(11) default null, + primary key (pk1,pk2), + key key1 (key1), + key key2 (key2)) engine=bdb; +insert into t1 values ('','empt',2,2), ('a','a--a',2,2), + ('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2); +select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + -- cgit v1.2.1 From 3db93f8086fcc4777c06b8342c1fb4f7478c9356 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Jun 2004 16:44:34 +0300 Subject: lower_case_table_names=2 (Keep case for table names) was not honored with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109) Make net_buffer_length visible for mysql clients (Bug #4206) include/mysql.h: Make net_buffer_length visible for mysql clients libmysql/libmysql.c: Make net_buffer_length visible for mysql clients mysql-test/mysql-test-run.sh: Don't give warning for some common 'safe' warnings mysql-test/r/lowercase_table2.result: Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109) mysql-test/t/lowercase_table2.test: Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109) scripts/mysql_install_db.sh: Removed not used variable sql/sql_table.cc: lower_case_table_names=2 (Keep case for table names) was not honored with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109) --- mysql-test/mysql-test-run.sh | 2 +- mysql-test/r/lowercase_table2.result | 10 ++++++++++ mysql-test/t/lowercase_table2.test | 11 +++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 1671e9416fb..449b7015188 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -668,7 +668,7 @@ report_stats () { # $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp # Remove some non fatal warnings from the log files - $SED -e 's!Warning: Table:.* on delete!!g' \ + $SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \ $MY_LOG_DIR/*.err > $MY_LOG_DIR/warnings.tmp found_error=0 diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index 737d49fc340..d2283927789 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -121,3 +121,13 @@ LOCATION Mic-5 Mic-6 drop table T1; +create table T1 (A int); +alter table T1 add index (A); +show tables like 'T1%'; +Tables_in_test (T1%) +T1 +alter table t1 add index (A); +show tables like 't1%'; +Tables_in_test (t1%) +t1 +drop table t1; diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index 8f542a7af78..4a56b16a441 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -89,3 +89,14 @@ SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHER SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; drop table T1; + +# +# Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109) +# + +create table T1 (A int); +alter table T1 add index (A); +show tables like 'T1%'; +alter table t1 add index (A); +show tables like 't1%'; +drop table t1; -- cgit v1.2.1 From afe29967e03d5c936c378fff9ea4e4bcf7e9251e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Jun 2004 14:54:28 +0200 Subject: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Added put_length() to get_length() and unpack_key() to pack_key(). Keys were packed with the minimum size of the length field for the key part and unpacked with length size of the base column. For the purpose of optimal key packing we have the method pack_key(), while rows are packed with pack(). Now keys are unpacked with unpack_key() and no longer with unpack() which is used for rows. mysql-test/r/bdb.result: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Added the test case results. mysql-test/t/bdb.test: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Added the test case. sql/field.cc: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Added put_length() to get_length() and unpack_key() to pack_key(). Keys were packed with the minimum size of the length field for the key part and unpacked with length size of the base column. For the purpose of optimal key packing we have the method pack_key(), while rows are packed with pack(). Now keys are unpacked with unpack_key() and no longer with unpack() which is used for rows. sql/field.h: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Added put_length() to get_length() and unpack_key() to pack_key(). The default implementation simply calls unpack() for those field types that don't need a special key unpacking. sql/ha_berkeley.cc: bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash. Now keys are unpacked with unpack_key() and no longer with unpack() which is used for rows. For most field types, however, this simply calls unpack(). --- mysql-test/r/bdb.result | 16 ++++++++++++++++ mysql-test/t/bdb.test | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 2ccb5148d58..684efa722ff 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1190,3 +1190,19 @@ a A a drop table t1; +create table t1( +pk1 text not null, pk2 text not null, pk3 char(4), +key1 int, key2 int, +primary key(pk1(4), pk2(4), pk3), key(key1), key(key2) +) engine=bdb; +insert into t1 values (concat('aaa-', repeat('A', 4000)), +concat('eee-', repeat('e', 4000)), 'a++a', 1, 1); +insert into t1 values (concat('bbb-', repeat('B', 4000)), +concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1); +select substring(pk1, 1, 4), substring(pk1, 4001), +substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2 +from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +substring(pk1, 1, 4) substring(pk1, 4001) substring(pk2, 1, 4) substring(pk2, 4001) pk3 key1 key2 +aaa- AAAA eee- eeee a++a 1 1 +bbb- BBBB ggg- GGGG b++b 1 1 +drop table t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 4b490052535..504a24a5c17 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -829,3 +829,22 @@ alter table t1 modify a char(10) binary; explain select a from t1; select a from t1; drop table t1; + +# +# bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash +# + +create table t1( + pk1 text not null, pk2 text not null, pk3 char(4), + key1 int, key2 int, + primary key(pk1(4), pk2(4), pk3), key(key1), key(key2) +) engine=bdb; +insert into t1 values (concat('aaa-', repeat('A', 4000)), + concat('eee-', repeat('e', 4000)), 'a++a', 1, 1); +insert into t1 values (concat('bbb-', repeat('B', 4000)), + concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1); +select substring(pk1, 1, 4), substring(pk1, 4001), + substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2 + from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + -- cgit v1.2.1 From 8f6664c59a147469cd7abba8440ae43fc221b054 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Jun 2004 15:06:56 +0200 Subject: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Redesigned the handler close functions so that they are usable at different places where waiting for closing tables is done. mysql-test/r/flush_table.result: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Added the test results. mysql-test/t/flush_table.test: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Activated old test case. Added new test cases. sql/mysql_priv.h: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Made mysql_ha_close() more flexible. Removed mysql_ha_closeall(), which closed only one table despite its name. Added mysql_ha_close_list(), which closes the complete list or all tables and does not lock. Removed a duplicate declaration. sql/sql_base.cc: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Added proper close calls before some wait points to avoid deadlocks or infinite loops. sql/sql_handler.cc: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Redesigned the internal function find_table_ptr_by_name(). It can now suppress locking and tells if the requested table has been flushed by itself. Extended mysql_ha_close() so that it can now suppres locking and error reporting. That way it can be used at more places and the old function mysql_ha_closeall() is now obsolete. Added a new function mysql_ha_close_list() which closes a whole list of HANDLER tables or all HANDLER tables, if the list is NULL. Furthermore is can close all 'old' (marked for flush) HANDLER tables. sql/sql_table.cc: bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock. Replaced the obsolte mysql_ha_closeall() by the new mysql_ha_close(). --- mysql-test/r/flush_table.result | 120 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/flush_table.test | 115 +++++++++++++++++++++++++++++++++++--- 2 files changed, 228 insertions(+), 7 deletions(-) create mode 100644 mysql-test/r/flush_table.result (limited to 'mysql-test') diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result new file mode 100644 index 00000000000..cfba428e2e8 --- /dev/null +++ b/mysql-test/r/flush_table.result @@ -0,0 +1,120 @@ +drop table if exists t1; +create table t1 (a int not null auto_increment primary key); +insert into t1 values(0); +lock table t1 read; +flush table t1; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +drop database if exists test_test; +create database test_test; +use test_test; +create table t1(table_id char(20) primary key); +insert into t1 values ('test_test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +table_id +test_test.t1 + +create table t2(table_id char(20) primary key); +insert into t2 values ('test_test.t2'); +insert into t2 values (''); +handler t2 open; +handler t2 read first limit 9; +table_id +test_test.t2 + +use test; +drop table if exists t1; +create table t1(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +table_id +test.t1 + +use test; +handler test.t1 read first limit 9; +table_id +test.t1 + +handler test.t2 read first limit 9; +Unknown table 't2' in HANDLER +handler test_test.t1 read first limit 9; +table_id +test_test.t1 + +handler test_test.t2 read first limit 9; +table_id +test_test.t2 + +handler test_test.t1 close; +drop table test_test.t1; +handler test_test.t2 close; +drop table test_test.t2; +drop database test_test; +use test; +handler test.t1 close; +drop table test.t1; +drop table if exists t1; +drop table if exists t2; +create table t1(table_id char(20) primary key); +create table t2(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +insert into t2 values ('test.t2'); +insert into t2 values (''); +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +table_id +test.t1 + +handler a2 read first limit 9; +table_id +test.t1 + +handler t2 read first limit 9; +table_id +test.t2 + +flush tables; +handler a1 read first limit 9; +Unknown table 'a1' in HANDLER +handler a2 read first limit 9; +Unknown table 'a2' in HANDLER +handler t2 read first limit 9; +Unknown table 't2' in HANDLER +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +table_id +test.t1 + +handler a2 read first limit 9; +table_id +test.t1 + +handler t2 read first limit 9; +table_id +test.t2 + +flush table t1; +handler a1 read first limit 9; +Unknown table 'a1' in HANDLER +handler a2 read first limit 9; +Unknown table 'a2' in HANDLER +handler t2 read first limit 9; +table_id +test.t2 + +flush table t2; +handler t2 close; +Unknown table 't2' in HANDLER +drop table t1; +drop table t2; diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index 4ddcd53d5c8..ad81f266afc 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -4,10 +4,111 @@ # Test of flush table # -#drop table if exists t1; -#create table t1 (a int not null auto_increment primary key); -#insert into t1 values(0); -#lock table t1 read; -#flush table t1; -#check table t1; -#drop table t1; +drop table if exists t1; +create table t1 (a int not null auto_increment primary key); +insert into t1 values(0); +lock table t1 read; +flush table t1; +check table t1; +drop table t1; + +# +# Check if two database names beginning the same are seen as different. +# +# This database begins like the usual 'test' database. +# +--disable_warnings +drop database if exists test_test; +--enable_warnings +create database test_test; +use test_test; +create table t1(table_id char(20) primary key); +insert into t1 values ('test_test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +create table t2(table_id char(20) primary key); +insert into t2 values ('test_test.t2'); +insert into t2 values (''); +handler t2 open; +handler t2 read first limit 9; +# +# This is the usual 'test' database. +# +use test; +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +# +# Check accesibility of all the tables. +# +use test; +handler test.t1 read first limit 9; +--error 1109; +handler test.t2 read first limit 9; +handler test_test.t1 read first limit 9; +handler test_test.t2 read first limit 9; +# +# Cleanup. +# +handler test_test.t1 close; +drop table test_test.t1; +handler test_test.t2 close; +drop table test_test.t2; +drop database test_test; +# +use test; +handler test.t1 close; +drop table test.t1; + +# +# In the following test FLUSH TABLES produces a deadlock +# (hang forever) if the fix for bug#3565 is missing. +# +--disable_warnings +drop table if exists t1; +drop table if exists t2; +--enable_warnings +create table t1(table_id char(20) primary key); +create table t2(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +insert into t2 values ('test.t2'); +insert into t2 values (''); +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush tables; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +--error 1109; +handler t2 read first limit 9; +# +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t1; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t2; +--error 1109; +handler t2 close; +drop table t1; +drop table t2; + -- cgit v1.2.1