diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-05-19 13:32:21 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-05-19 13:32:21 +0200 |
commit | 1bfe9789ff917b97ed9def4194fc7d95fa866f7b (patch) | |
tree | cfd0346dd74219aab5da9183c09bcbd2800ab529 /mysql-test/r/innodb_mysql_lock.result | |
parent | 198d51efe7a7bcd9ffceb2953faccc39d6df55d6 (diff) | |
download | mariadb-git-1bfe9789ff917b97ed9def4194fc7d95fa866f7b.tar.gz |
Bug #53798 OPTIMIZE TABLE breaks repeatable read
The problem was that OPTMIZE TABLE was allowed to run on a table
in use by a transaction in a different connection. This caused
repeatable read to break.
This bug was fixed by the introduction of metadata locking, WL#4284.
OPTIMIZE TABLE will now be blocked until the transaction using the
table, has ended.
This patch contains a regression test added to innodb_mysql_lock.test
and no code changes.
Diffstat (limited to 'mysql-test/r/innodb_mysql_lock.result')
-rw-r--r-- | mysql-test/r/innodb_mysql_lock.result | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index 375ae8aeb12..95adf712cb4 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -86,3 +86,33 @@ release_lock('bug42147_lock') UNLOCK TABLES; # Connection 1 DROP TABLE t1; +# +# Bug#53798 OPTIMIZE TABLE breaks repeatable read +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT) engine=innodb; +INSERT INTO t1 VALUES (1), (2), (3); +# Connection con1 +START TRANSACTION WITH CONSISTENT SNAPSHOT; +SELECT * FROM t1; +a +1 +2 +3 +# Connection default +# This should block +# Sending: +OPTIMIZE TABLE t1; +# Connection con1 +SELECT * FROM t1; +a +1 +2 +3 +COMMIT; +# Connection default +# Reaping OPTIMIZE TABLE t1 +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; |