summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-11-04 19:19:51 +0100
committerunknown <guilhem@mysql.com>2004-11-04 19:19:51 +0100
commit4a56b28461ea6b7296680dbd32c11275e08d6c0f (patch)
treedd1783b31a665f180386d64b7e39ec313fec5dfa /mysql-test
parent6ed9208e10bb31ddf297c9a3f65411c5bd7bda00 (diff)
parente30bd1e48d8ef68a92dd8443611b1e3d8e356c7a (diff)
downloadmariadb-git-4a56b28461ea6b7296680dbd32c11275e08d6c0f.tar.gz
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result21
-rw-r--r--mysql-test/t/mix_innodb_myisam_binlog-master.opt1
-rw-r--r--mysql-test/t/mix_innodb_myisam_binlog.test32
3 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
index 7b266544c92..93a647f673c 100644
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ b/mysql-test/r/mix_innodb_myisam_binlog.result
@@ -177,4 +177,25 @@ master-bin.001 79 Query 1 79 use `test`; BEGIN
master-bin.001 119 Query 1 79 use `test`; insert into t1 values(16)
master-bin.001 179 Query 1 79 use `test`; insert into t1 values(18)
master-bin.001 239 Query 1 239 use `test`; COMMIT
+delete from t1;
+delete from t2;
+alter table t2 type=MyISAM;
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+a
+1
+select (@before:=unix_timestamp())*0;
+(@before:=unix_timestamp())*0
+0
+begin;
+ select * from t1 for update;
+insert into t2 values (20);
+Lock wait timeout exceeded; Try restarting transaction
+select (@after:=unix_timestamp())*0;
+(@after:=unix_timestamp())*0
+0
+select (@after-@before) >= 2;
+(@after-@before) >= 2
+1
drop table t1,t2;
diff --git a/mysql-test/t/mix_innodb_myisam_binlog-master.opt b/mysql-test/t/mix_innodb_myisam_binlog-master.opt
new file mode 100644
index 00000000000..cb48f1aaf60
--- /dev/null
+++ b/mysql-test/t/mix_innodb_myisam_binlog-master.opt
@@ -0,0 +1 @@
+--loose-innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test
index be45c2c3133..5f3b778c61a 100644
--- a/mysql-test/t/mix_innodb_myisam_binlog.test
+++ b/mysql-test/t/mix_innodb_myisam_binlog.test
@@ -175,4 +175,36 @@ select a from t1 order by a; # check that savepoints work :)
show binlog events from 79;
+# Test for BUG#5714, where a MyISAM update in the transaction used to
+# release row-level locks in InnoDB
+
+connect (con3,localhost,root,,);
+
+connection con3;
+delete from t1;
+delete from t2;
+--disable_warnings
+alter table t2 type=MyISAM;
+--enable_warnings
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+
+connection con2;
+select (@before:=unix_timestamp())*0; # always give repeatable output
+begin;
+send select * from t1 for update;
+
+connection con3;
+insert into t2 values (20);
+
+connection con2;
+--error 1205
+reap;
+select (@after:=unix_timestamp())*0; # always give repeatable output
+# verify that innodb_lock_wait_timeout was exceeded. When there was
+# the bug, the reap would return immediately after the insert into t2.
+select (@after-@before) >= 2;
+
+# cleanup
drop table t1,t2;