SET sql_mode=ORACLE; # # MDEV-10801 sql_mode: dynamic SQL placeholders # CREATE TABLE t1 (a INT, b INT); SET @a=10, @b=20; PREPARE stmt FROM 'INSERT INTO t1 VALUES (?,?)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:a,:b)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:aaa,:bbb)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"a",:"b")'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"aaa",:"bbb")'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:1,:2)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:222,:111)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:0,:65535)'; EXECUTE stmt USING @a, @b; PREPARE stmt FROM 'INSERT INTO t1 VALUES (:65535,:0)'; EXECUTE stmt USING @a, @b; SELECT * FROM t1; a b 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT) master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20) master-bin.000001 # Query # # COMMIT DROP TABLE t1; # # MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication # FLUSH LOGS; CREATE TABLE t1 (d DATE); INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24'); CREATE TABLE t2 (d DATE, c BIGINT); BEGIN EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param' USING 1; EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param WITH ROLLUP' USING 1; END; $$ DROP TABLE t1,t2; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Gtid # # GTID #-#-# master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (d DATE) master-bin.000002 # Gtid # # BEGIN GTID #-#-# master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24') master-bin.000002 # Query # # COMMIT master-bin.000002 # Gtid # # GTID #-#-# master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (d DATE, c BIGINT) master-bin.000002 # Gtid # # BEGIN GTID #-#-# master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1 master-bin.000002 # Query # # COMMIT master-bin.000002 # Gtid # # BEGIN GTID #-#-# master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1 WITH ROLLUP master-bin.000002 # Query # # COMMIT master-bin.000002 # Gtid # # GTID #-#-# master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */