Debian Codegraph @

mysql-test/suite/rpl/r/rpl_mdev382.result

raw
1 include/master-slave.inc
2 [connection master]
3 connection master;
4 create table t1 (a int primary key) engine=innodb;
5 create table t2 (a int primary key) engine=myisam;
6 begin;
7 insert into t1 values (1);
8 SET sql_mode = 'ANSI_QUOTES';
9 savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
10 insert into t1 values (2);
11 insert into t2 values (1);
12 SET sql_mode = '';
13 rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
14 Warnings:
15 Warning 1196 Some non-transactional changed tables couldn't be rolled back
16 insert into t1 values (3);
17 commit;
18 show binlog events from <binlog_start>;
19 Log_name Pos Event_type Server_id End_log_pos Info
20 master-bin.000001 # Gtid_list 1 # []
21 master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001
22 master-bin.000001 # Gtid 1 # GTID #-#-#
23 master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=innodb
24 master-bin.000001 # Gtid 1 # GTID #-#-#
25 master-bin.000001 # Query 1 # use `test`; create table t2 (a int primary key) engine=myisam
26 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
27 master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
28 master-bin.000001 # Query 1 # COMMIT
29 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
30 master-bin.000001 # Query 1 # use `test`; insert into t1 values (1)
31 master-bin.000001 # Query 1 # SAVEPOINT "a`; create database couldbebadthingshere; savepoint `dummy"
32 master-bin.000001 # Query 1 # use `test`; insert into t1 values (2)
33 master-bin.000001 # Query 1 # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy`
34 master-bin.000001 # Query 1 # use `test`; insert into t1 values (3)
35 master-bin.000001 # Xid 1 # COMMIT /* XID */
36 connection slave;
37 connection slave;
38 connection master;
39 BEGIN;
40 insert into t1 values(10);
41 set sql_mode = 'ANSI_QUOTES';
42 set sql_quote_show_create = 1;
43 savepoint a;
44 insert into t1 values(11);
45 savepoint "a""a";
46 insert into t1 values(12);
47 set sql_quote_show_create = 0;
48 savepoint b;
49 insert into t1 values(13);
50 savepoint "b""b";
51 insert into t1 values(14);
52 set sql_mode = '';
53 set sql_quote_show_create = 1;
54 savepoint c;
55 insert into t1 values(15);
56 savepoint `c``c`;
57 insert into t1 values(16);
58 set sql_quote_show_create = 0;
59 savepoint d;
60 insert into t1 values(17);
61 savepoint `d``d`;
62 insert into t1 values(18);
63 COMMIT;
64 set sql_quote_show_create = 1;
65 show binlog events from <binlog_start>;
66 Log_name Pos Event_type Server_id End_log_pos Info
67 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
68 master-bin.000001 # Query 1 # use `test`; insert into t1 values(10)
69 master-bin.000001 # Query 1 # SAVEPOINT "a"
70 master-bin.000001 # Query 1 # use `test`; insert into t1 values(11)
71 master-bin.000001 # Query 1 # SAVEPOINT "a""a"
72 master-bin.000001 # Query 1 # use `test`; insert into t1 values(12)
73 master-bin.000001 # Query 1 # SAVEPOINT b
74 master-bin.000001 # Query 1 # use `test`; insert into t1 values(13)
75 master-bin.000001 # Query 1 # SAVEPOINT "b""b"
76 master-bin.000001 # Query 1 # use `test`; insert into t1 values(14)
77 master-bin.000001 # Query 1 # SAVEPOINT `c`
78 master-bin.000001 # Query 1 # use `test`; insert into t1 values(15)
79 master-bin.000001 # Query 1 # SAVEPOINT `c``c`
80 master-bin.000001 # Query 1 # use `test`; insert into t1 values(16)
81 master-bin.000001 # Query 1 # SAVEPOINT d
82 master-bin.000001 # Query 1 # use `test`; insert into t1 values(17)
83 master-bin.000001 # Query 1 # SAVEPOINT `d``d`
84 master-bin.000001 # Query 1 # use `test`; insert into t1 values(18)
85 master-bin.000001 # Xid 1 # COMMIT /* XID */
86 *** Test correct USE statement in SHOW BINLOG EVENTS ***
87 connection master;
88 set sql_mode = 'ANSI_QUOTES';
89 CREATE DATABASE "db1`; select 'oops!'";
90 use "db1`; select 'oops!'";
91 CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM;
92 INSERT INTO t1 VALUES (1);
93 set sql_mode = '';
94 INSERT INTO t1 VALUES (2);
95 set sql_mode = 'ANSI_QUOTES';
96 show binlog events from <binlog_start>;
97 Log_name Pos Event_type Server_id End_log_pos Info
98 master-bin.000001 # Gtid 1 # GTID #-#-#
99 master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
100 master-bin.000001 # Gtid 1 # GTID #-#-#
101 master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
102 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
103 master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (1)
104 master-bin.000001 # Query 1 # COMMIT
105 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
106 master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (2)
107 master-bin.000001 # Query 1 # COMMIT
108 set sql_mode = '';
109 set sql_quote_show_create = 0;
110 show binlog events from <binlog_start>;
111 Log_name Pos Event_type Server_id End_log_pos Info
112 master-bin.000001 # Gtid 1 # GTID #-#-#
113 master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
114 master-bin.000001 # Gtid 1 # GTID #-#-#
115 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
116 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
117 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1)
118 master-bin.000001 # Query 1 # COMMIT
119 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
120 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2)
121 master-bin.000001 # Query 1 # COMMIT
122 set sql_quote_show_create = 1;
123 show binlog events from <binlog_start>;
124 Log_name Pos Event_type Server_id End_log_pos Info
125 master-bin.000001 # Gtid 1 # GTID #-#-#
126 master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
127 master-bin.000001 # Gtid 1 # GTID #-#-#
128 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
129 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
130 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1)
131 master-bin.000001 # Query 1 # COMMIT
132 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
133 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2)
134 master-bin.000001 # Query 1 # COMMIT
135 DROP TABLE t1;
136 use test;
137 ***Test LOAD DATA INFILE with various identifiers that need correct quoting ***
138 use `db1``; select 'oops!'`;
139 set timestamp=1000000000;
140 CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
141 `c``3` VARCHAR(7));
142 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1`
143 FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
144 LINES TERMINATED BY '\n'
145 (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!");
146 SELECT * FROM `t``1`;
147 a`1 b`2 c`3
148 fo\o bar |b"a'z!
149 truncate `t``1`;
150 use test;
151 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt'
152 INTO TABLE `db1``; select 'oops!'`.`t``1`
153 FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
154 LINES TERMINATED BY '\n'
155 (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!");
156 SELECT * FROM `db1``; select 'oops!'`.`t``1`;
157 a`1 b`2 c`3
158 fo\o bar |b"a'z!
159 show binlog events from <binlog_start>;
160 Log_name Pos Event_type Server_id End_log_pos Info
161 master-bin.000001 # Gtid 1 # GTID #-#-#
162 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
163 `c``3` VARCHAR(7))
164 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
165 master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14
166 master-bin.000001 # Execute_load_query 1 # use `db1``; select 'oops!'`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") ;file_id=#
167 master-bin.000001 # Query 1 # COMMIT
168 master-bin.000001 # Gtid 1 # GTID #-#-#
169 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; truncate `t``1`
170 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
171 master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14
172 master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") ;file_id=#
173 master-bin.000001 # Query 1 # COMMIT
174 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
175 /*!40019 SET @@session.max_delayed_threads=0*/;
176 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
177 DELIMITER /*!*/;
178 ROLLBACK/*!*/;
179 use `db1``; select 'oops!'`/*!*/;
180 SET TIMESTAMP=1000000000/*!*/;
181 SET @@session.pseudo_thread_id=999999999/*!*/;
182 SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
183 SET @@session.sql_mode=0/*!*/;
184 SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
185 /*!\C latin1 *//*!*/;
186 SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/;
187 SET @@session.lc_time_names=0/*!*/;
188 SET @@session.collation_database=DEFAULT/*!*/;
189 CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
190 `c``3` VARCHAR(7))
191 /*!*/;
192 START TRANSACTION
193 /*!*/;
194 SET TIMESTAMP=1000000000/*!*/;
195 LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!")
196 /*!*/;
197 SET TIMESTAMP=1000000000/*!*/;
198 COMMIT
199 /*!*/;
200 SET TIMESTAMP=1000000000/*!*/;
201 truncate `t``1`
202 /*!*/;
203 START TRANSACTION
204 /*!*/;
205 use `test`/*!*/;
206 SET TIMESTAMP=1000000000/*!*/;
207 LOAD DATA LOCAL INFILE '<name>' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!")
208 /*!*/;
209 SET TIMESTAMP=1000000000/*!*/;
210 COMMIT
211 /*!*/;
212 DELIMITER ;
213 # End of log file
214 ROLLBACK /* added by mysqlbinlog */;
215 /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
216 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
217 connection slave;
218 connection slave;
219 SELECT * FROM `db1``; select 'oops!'`.`t``1`;
220 a`1 b`2 c`3
221 fo\o bar |b"a'z!
222 connection master;
223 DROP TABLE `db1``; select 'oops!'`.`t``1`;
224 connection master;
225 drop table t1,t2;
226 *** Test truncation of long SET expression in LOAD DATA ***
227 CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
228 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE t1
229 FIELDS TERMINATED BY ','
230 (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b);
231 SELECT * FROM t1 ORDER BY a;
232 a b
233 1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
234 2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
235 show binlog events from <binlog_start>;
236 Log_name Pos Event_type Server_id End_log_pos Info
237 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
238 master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=8
239 master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b) ;file_id=#
240 master-bin.000001 # Query 1 # COMMIT
241 connection slave;
242 connection slave;
243 SELECT * FROM t1 ORDER BY a;
244 a b
245 1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
246 2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
247 connection master;
248 DROP TABLE t1;
249 *** Test user variables whose names require correct quoting ***
250 use `db1``; select 'oops!'`;
251 CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100));
252 INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100));
253 SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1;
254 @`a``1`:=a1 @`a``2`:=a2 @`a``3`:=a3 @`a``4`:=a4 @`b```:=b @```c`:=c @```d```:=d
255 -9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
256 INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98));
257 show binlog events from <binlog_start>;
258 Log_name Pos Event_type Server_id End_log_pos Info
259 master-bin.000001 # Gtid 1 # GTID #-#-#
260 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
261 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
262 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
263 master-bin.000001 # Query 1 # COMMIT
264 master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
265 master-bin.000001 # User var 1 # @`a``1`=-9223372036854775808
266 master-bin.000001 # User var 1 # @`a``2`=42
267 master-bin.000001 # User var 1 # @`a``3`=9223372036854775807
268 master-bin.000001 # User var 1 # @`a``4`=18446744073709551615
269 master-bin.000001 # User var 1 # @`b```=-1.234560123456789e125
270 master-bin.000001 # User var 1 # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
271 master-bin.000001 # User var 1 # @```d```=_utf8mb4 X'78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878' COLLATE utf8mb4_uca1400_ai_ci
272 master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
273 master-bin.000001 # Query 1 # COMMIT
274 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
275 /*!40019 SET @@session.max_delayed_threads=0*/;
276 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
277 DELIMITER /*!*/;
278 ROLLBACK/*!*/;
279 use `db1``; select 'oops!'`/*!*/;
280 SET TIMESTAMP=1000000000/*!*/;
281 SET @@session.pseudo_thread_id=999999999/*!*/;
282 SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
283 SET @@session.sql_mode=0/*!*/;
284 SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
285 /*!\C latin1 *//*!*/;
286 SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/;
287 SET @@session.lc_time_names=0/*!*/;
288 SET @@session.collation_database=DEFAULT/*!*/;
289 CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
290 /*!*/;
291 START TRANSACTION
292 /*!*/;
293 SET TIMESTAMP=1000000000/*!*/;
294 INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
295 /*!*/;
296 SET TIMESTAMP=1000000000/*!*/;
297 COMMIT
298 /*!*/;
299 START TRANSACTION
300 /*!*/;
301 SET @`a``1`:=-9223372036854775808/*!*/;
302 SET @`a``2`:=42/*!*/;
303 SET @`a``3`:=9223372036854775807/*!*/;
304 SET @`a``4`:=18446744073709551615/*!*/;
305 SET @`b```:=-1.2345601234568e+125/*!*/;
306 SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/;
307 SET @```d```:=_utf8mb4 X'78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878' COLLATE `utf8mb4_uca1400_ai_ci`/*!*/;
308 SET TIMESTAMP=1000000000/*!*/;
309 INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
310 /*!*/;
311 SET TIMESTAMP=1000000000/*!*/;
312 COMMIT
313 /*!*/;
314 DELIMITER ;
315 # End of log file
316 ROLLBACK /* added by mysqlbinlog */;
317 /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
318 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
319 connection slave;
320 connection slave;
321 SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1;
322 a1 a2 a3 a4 b c d
323 -9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
324 -9223372036854775807 4200 9223372036854775806 18446744073709551614 -6.172800617283945e124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
325 connection master;
326 DROP TABLE t1;
327 *** Test correct quoting in foreign key error message ***
328 use `db1``; select 'oops!'`;
329 CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb;
330 CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL,
331 FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb;
332 TRUNCATE `t``1`;
333 ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `fk` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```))
334 DROP TABLE `t``2`;
335 DROP TABLE `t``1`;
336 *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
337 connection slave;
338 include/stop_slave.inc
339 connection master;
340 CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
341 INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5);
342 SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1;
343 a`
344 1
345 2
346 5
347 connection default;
348 connection server_1;
349 connection master;
350 set timestamp=1000000000;
351 # The table should be empty on the master.
352 SELECT * FROM `db1``; select 'oops!'`.`t``1`;
353 a`
354 # The DELETE statement should be correctly quoted
355 show binlog events in 'master-bin.000002' from <binlog_start>;
356 Log_name Pos Event_type Server_id End_log_pos Info
357 master-bin.000002 # Gtid 1 # GTID #-#-#
358 master-bin.000002 # Query 1 # TRUNCATE TABLE `db1``; select 'oops!'`.`t``1` /* generated by server for memory table after a restart */
359 connection slave;
360 include/start_slave.inc
361 connection master;
362 connection slave;
363 connection slave;
364 # The table should be empty on the slave also.
365 SELECT * FROM `db1``; select 'oops!'`.`t``1`;
366 a`
367 connection master;
368 DROP TABLE `db1``; select 'oops!'`.`t``1`;
369 connection slave;
370 connection master;
371 use test;
372 DROP DATABASE `db1``; select 'oops!'`;
373 *** Test correct quoting of mysqlbinlog --rewrite-db option ***
374 CREATE TABLE t1 (a INT PRIMARY KEY);
375 INSERT INTO t1 VALUES(1);
376 show binlog events in 'master-bin.000002' from <binlog_start>;
377 Log_name Pos Event_type Server_id End_log_pos Info
378 master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
379 master-bin.000002 # Query 1 # use `test`; INSERT INTO t1 VALUES(1)
380 master-bin.000002 # Query 1 # COMMIT
381 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
382 /*!40019 SET @@session.max_delayed_threads=0*/;
383 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
384 DELIMITER /*!*/;
385 ROLLBACK/*!*/;
386 START TRANSACTION
387 /*!*/;
388 use `ts``et`/*!*/;
389 SET TIMESTAMP=1000000000/*!*/;
390 SET @@session.pseudo_thread_id=999999999/*!*/;
391 SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
392 SET @@session.sql_mode=1411383296/*!*/;
393 SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
394 /*!\C latin1 *//*!*/;
395 SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/;
396 SET @@session.lc_time_names=0/*!*/;
397 SET @@session.collation_database=DEFAULT/*!*/;
398 INSERT INTO t1 VALUES(1)
399 /*!*/;
400 SET TIMESTAMP=1000000000/*!*/;
401 COMMIT
402 /*!*/;
403 DELIMITER ;
404 # End of log file
405 ROLLBACK /* added by mysqlbinlog */;
406 /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
407 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
408 DROP TABLE t1;
409 include/rpl_end.inc