summaryrefslogtreecommitdiff
path: root/mysql-test/r/alter_table-big.result
diff options
context:
space:
mode:
authorunknown <dlenev@mockturtle.local>2007-01-19 23:15:59 +0300
committerunknown <dlenev@mockturtle.local>2007-01-19 23:15:59 +0300
commitac5e6f60a80e248227207d6c375ecf6b213e3046 (patch)
tree3b3d729cb85d01f23ffaae4eeea2c049a05d701c /mysql-test/r/alter_table-big.result
parent5d68cff03a464571b5a9460c0b20edc559cd14db (diff)
downloadmariadb-git-ac5e6f60a80e248227207d6c375ecf6b213e3046.tar.gz
Fix for bug #25044 "ALTER TABLE ... ENABLE KEYS acquires global 'opening
tables' lock." Execution of ALTER TABLE ... ENABLE KEYS on a table (which can take rather long time) prevented concurrent execution of all statements using tables. The problem was caused by the fact that we were holding LOCK_open mutex during whole duration of this statement and particularly during call to handler::enable_indexes(). This behavior was introduced as part of the fix for bug 14262 "SP: DROP PROCEDURE|VIEW (maybe more) write to binlog too late (race cond)" The patch simply restores old behavior. Note that we can safely do this as this operation takes exclusive lock (similar to name-lock) which blocks both DML and DDL on the table being altered. It also introduces mysql-test/include/wait_show_pattern.inc helper script which is used to make test-case for this bug robust enough. mysql-test/include/wait_slave_status.inc: Now wait_slave_status.inc reuses more generic wait_output_matches.inc script. sql/sql_table.cc: mysql_alter_table(): Changed ALTER TABLE ... ENABLE/DISABLE KEYS not to hold LOCK_open mutex during call to handler::enable_indexes() as the latter can take rather long time and therefore such ALTER would block execution of all other statements that use tables. We can safely do this as this operation takes exclusive lock (similar to name-lock) on the table which is altered. mysql-test/include/wait_show_pattern.inc: New BitKeeper file ``mysql-test/include/wait_show_pattern.inc'' mysql-test/r/alter_table-big.result: New BitKeeper file ``mysql-test/r/alter_table-big.result'' mysql-test/t/alter_table-big.test: New BitKeeper file ``mysql-test/t/alter_table-big.test''
Diffstat (limited to 'mysql-test/r/alter_table-big.result')
-rw-r--r--mysql-test/r/alter_table-big.result18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table-big.result b/mysql-test/r/alter_table-big.result
new file mode 100644
index 00000000000..873978c60de
--- /dev/null
+++ b/mysql-test/r/alter_table-big.result
@@ -0,0 +1,18 @@
+drop table if exists t1, t2;
+create table t1 (n1 int, n2 int, n3 int,
+key (n1, n2, n3),
+key (n2, n3, n1),
+key (n3, n1, n2));
+create table t2 (i int);
+alter table t1 disable keys;
+reset master;
+alter table t1 enable keys;;
+insert into t2 values (1);
+insert into t1 values (1, 1, 1);
+show binlog events in 'master-bin.000001' from 98;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
+master-bin.000001 # Query 1 # use `test`; alter table t1 enable keys
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (1, 1, 1)
+drop tables t1, t2;
+End of 5.0 tests