From 90f2c822469a4f88f882ba8974e790f0fb0b2702 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 5 Oct 2015 16:09:21 +0500 Subject: 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. --- mysql-test/t/create_drop_binlog.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t/create_drop_binlog.test') 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 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; + -- cgit v1.2.1