3425 Jon Olav Hauglid 2011-11-16
WL#5534 Online ALTER, Phase 1.
Patch #49:
Expanded test coverage - added regression test for
Bug#11750045 regarding ALTER IGNORE TABLE.
modified:
mysql-test/r/innodb_mysql_lock.result
mysql-test/t/innodb_mysql_lock.test
3424 Jon Olav Hauglid 2011-11-16
WL#5534 Online ALTER, Phase 1.
Patch #48: Review fixes, part 5.
- Move tmp_table check to is_inplace_alter_impossible()
- Move ignore check to default implementation of
handler::check_if_supported_inplace_alter()
- Added ignore flag to Alter_inplace_info.
modified:
sql/handler.cc
sql/handler.h
sql/sql_table.cc
=== modified file 'mysql-test/r/innodb_mysql_lock.result'
--- a/mysql-test/r/innodb_mysql_lock.result 2011-06-01 12:24:51 +0000
+++ b/mysql-test/r/innodb_mysql_lock.result 2011-11-16 14:46:04 +0000
@@ -184,3 +184,21 @@ CREATE INDEX t1ba ON t1(b,a);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
+#
+# Bug#11750045 - 40344: ALTER IGNORE TABLE T ADD INDEX DOES NOT IGNORE
+# IN FAST INDEX CREATION
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT NOT NULL, b INT) engine = innodb;
+INSERT INTO t1 VALUES (1,1), (2,1), (3,1);
+# Should give error
+ALTER TABLE t1 ADD UNIQUE INDEX (b);
+ERROR 23000: Duplicate entry '1' for key 'b'
+# Should not give error
+# Also check that copy algorithm is used
+ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (b);
+affected rows: 3
+info: Records: 3 Duplicates: 2 Warnings: 0
+SHOW WARNINGS;
+Level Code Message
+DROP TABLE t1;
=== modified file 'mysql-test/t/innodb_mysql_lock.test'
--- a/mysql-test/t/innodb_mysql_lock.test 2011-06-01 12:24:51 +0000
+++ b/mysql-test/t/innodb_mysql_lock.test 2011-11-16 14:46:04 +0000
@@ -336,6 +336,32 @@ CREATE INDEX t1ba ON t1(b,a);
DROP TABLE t1;
+--echo #
+--echo # Bug#11750045 - 40344: ALTER IGNORE TABLE T ADD INDEX DOES NOT IGNORE
+--echo # IN FAST INDEX CREATION
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT NOT NULL, b INT) engine = innodb;
+INSERT INTO t1 VALUES (1,1), (2,1), (3,1);
+
+--echo # Should give error
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD UNIQUE INDEX (b);
+
+--echo # Should not give error
+--echo # Also check that copy algorithm is used
+--enable_info
+ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (b);
+--disable_info
+SHOW WARNINGS;
+
+DROP TABLE t1;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl5534 branch (jon.hauglid:3424 to 3425) WL#5534 | Jon Olav Hauglid | 17 Nov |