summaryrefslogtreecommitdiff
path: root/mysql-test/t/create_drop_binlog.test
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2015-10-05 16:09:21 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2015-10-06 00:18:41 +0500
commit90f2c822469a4f88f882ba8974e790f0fb0b2702 (patch)
tree0b3dd47fbc04c550a03853a37082faa9d2eb19b4 /mysql-test/t/create_drop_binlog.test
parent3c47809bc27486984bc56712b3db019d0720f30a (diff)
downloadmariadb-git-90f2c822469a4f88f882ba8974e790f0fb0b2702.tar.gz
MDEV-7817 ALTER TABLE {ADD|DROP} INDEX IF [NOT] EXISTS does not get written into binlog if nothing to do.
Just log the ALTER statement even if there's nothing to do.
Diffstat (limited to 'mysql-test/t/create_drop_binlog.test')
-rw-r--r--mysql-test/t/create_drop_binlog.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/create_drop_binlog.test b/mysql-test/t/create_drop_binlog.test
index aa772df4805..59a66d59e6f 100644
--- a/mysql-test/t/create_drop_binlog.test
+++ b/mysql-test/t/create_drop_binlog.test
@@ -175,3 +175,22 @@ SHOW MASTER STATUS;
RESET MASTER;
--replace_result $pos <pos>
SHOW MASTER STATUS;
+
+#
+# mdev-7817 ALTER TABLE {ADD|DROP} INDEX IF [NOT] EXISTS does not get written into binlog if nothing to do
+#
+
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+SHOW CREATE TABLE t1;
+DROP INDEX IF EXISTS i1 ON t1;
+DROP INDEX IF EXISTS i1 ON t1;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+