summaryrefslogtreecommitdiff
path: root/mysql-test/r
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/r
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/r')
-rw-r--r--mysql-test/r/create_drop_binlog.result45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/create_drop_binlog.result b/mysql-test/r/create_drop_binlog.result
index c5d66613aed..537a1bd4605 100644
--- a/mysql-test/r/create_drop_binlog.result
+++ b/mysql-test/r/create_drop_binlog.result
@@ -345,3 +345,48 @@ RESET MASTER;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 <pos>
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+Warnings:
+Note 1050 Table 't1' already exists
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+Warnings:
+Note 1061 Duplicate key name 'i1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP INDEX IF EXISTS i1 ON t1;
+DROP INDEX IF EXISTS i1 ON t1;
+Warnings:
+Note 1091 Can't DROP 'i1'; check that column/key exists
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE INDEX IF NOT EXISTS i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE INDEX IF NOT EXISTS i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP INDEX IF EXISTS i1 ON t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP INDEX IF EXISTS i1 ON t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+RESET MASTER;