#At file:///export/home/x/mysql-5.5-test/ based on revid:vasil.dimov@stripped
3341 Jon Olav Hauglid 2011-02-17
Bug #11784056 ENABLE CONCURRENT READS WHILE CREATING
NON-PRIMARY UNIQUE INDEX USING INNODB
This patch adds the HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE
capability flag to InnoDB, indicating that concurrent reads
can be allowed while non-primary unique indexes are created.
This is an follow-up to Bug #11751388 which enabled concurrent
reads when creating non-primary non-unique indexes.
Test case added to innodb_mysql_sync.test.
modified:
mysql-test/r/innodb_mysql_sync.result
mysql-test/t/innodb_mysql_sync.test
storage/innobase/handler/ha_innodb.cc
=== modified file 'mysql-test/r/innodb_mysql_sync.result'
--- a/mysql-test/r/innodb_mysql_sync.result 2011-01-26 13:23:29 +0000
+++ b/mysql-test/r/innodb_mysql_sync.result 2011-02-17 14:21:45 +0000
@@ -153,5 +153,15 @@ SET DEBUG_SYNC= "now SIGNAL query";
a b
# Test 4: Secondary unique index, should not block reads.
# Connection default
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+# Sending:
+ALTER TABLE t1 ADD UNIQUE (b);
+# Connection con1
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+SELECT * FROM t1;
+a b
+SET DEBUG_SYNC= "now SIGNAL query";
+# Connection default
+# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
SET DEBUG_SYNC= "RESET";
DROP TABLE t1;
=== modified file 'mysql-test/t/innodb_mysql_sync.test'
--- a/mysql-test/t/innodb_mysql_sync.test 2011-01-26 13:23:29 +0000
+++ b/mysql-test/t/innodb_mysql_sync.test 2011-02-17 14:21:45 +0000
@@ -253,26 +253,23 @@ connection con1;
--reap
--echo # Test 4: Secondary unique index, should not block reads.
-# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported
-# by InnoDB. Adding this flag currently introduces a regression so
-# this test is disabled until the regression has been fixed.
--echo # Connection default
connection default;
-#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
-#--echo # Sending:
-#--send ALTER TABLE t1 ADD UNIQUE (b)
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+--echo # Sending:
+--send ALTER TABLE t1 ADD UNIQUE (b)
-#--echo # Connection con1
-#connection con1;
-#SET DEBUG_SYNC= "now WAIT_FOR manage";
-#SELECT * FROM t1;
-#SET DEBUG_SYNC= "now SIGNAL query";
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+SELECT * FROM t1;
+SET DEBUG_SYNC= "now SIGNAL query";
-#--echo # Connection default
-#connection default;
-#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b)
-#--reap
+--echo # Connection default
+connection default;
+--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b)
+--reap
disconnect con1;
disconnect con2;
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2011-02-08 15:47:33 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2011-02-17 14:21:45 +0000
@@ -2597,6 +2597,7 @@ innobase_alter_table_flags(
| HA_INPLACE_ADD_INDEX_NO_WRITE
| HA_INPLACE_DROP_INDEX_NO_READ_WRITE
| HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE
+ | HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE
| HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE
| HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE);
}
Attachment: [text/bzr-bundle] bzr/jon.hauglid@oracle.com-20110217142145-76x5th4h81l26ob4.bundle