1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
|
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
==== Initialization ====
[on master]
SET @m_auto_increment_increment= @@global.auto_increment_increment;
SET @m_auto_increment_offset= @@global.auto_increment_offset;
SET @m_character_set_client= @@global.character_set_client;
SET @m_collation_connection= @@global.collation_connection;
SET @m_collation_server= @@global.collation_server;
SET @m_time_zone= @@global.time_zone;
SET @m_lc_time_names= @@global.lc_time_names;
SET @m_collation_database= @@global.collation_database;
[on slave]
SET @s_auto_increment_increment= @@global.auto_increment_increment;
SET @s_auto_increment_offset= @@global.auto_increment_offset;
SET @s_character_set_client= @@global.character_set_client;
SET @s_collation_connection= @@global.collation_connection;
SET @s_collation_server= @@global.collation_server;
SET @s_time_zone= @@global.time_zone;
SET @s_lc_time_names= @@global.lc_time_names;
SET @s_collation_database= @@global.collation_database;
SET @@global.auto_increment_increment=19;
SET @@global.auto_increment_offset=4;
SET @@global.character_set_client='latin2';
SET @@global.collation_connection='latin2_bin';
SET @@global.collation_server='geostd8_general_ci';
SET @@global.time_zone='Japan';
SET @@global.lc_time_names='sv_SE';
SET @@global.collation_database='geostd8_bin';
[on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
num INT,
text VARCHAR(100));
CREATE TABLE tproc LIKE tstmt;
CREATE TABLE tfunc LIKE tstmt;
CREATE TABLE ttrig LIKE tstmt;
CREATE TABLE tprep LIKE tstmt;
CREATE TABLE trigger_table (text CHAR(4));
==== Insert variables directly ====
SET @@pseudo_thread_id= 4712;
INSERT INTO tstmt(num) VALUES (@@session.pseudo_thread_id);
SET @@pseudo_thread_id= 4713;
INSERT INTO tstmt(num) VALUES (@@session.pseudo_thread_id);
SET @@foreign_key_checks= 0;
INSERT INTO tstmt(num) VALUES (@@session.foreign_key_checks);
SET @@foreign_key_checks= 1;
INSERT INTO tstmt(num) VALUES (@@session.foreign_key_checks);
SET @@sql_auto_is_null= 0;
INSERT INTO tstmt(num) VALUES (@@session.sql_auto_is_null);
SET @@sql_auto_is_null= 1;
INSERT INTO tstmt(num) VALUES (@@session.sql_auto_is_null);
SET @@unique_checks= 0;
INSERT INTO tstmt(num) VALUES (@@session.unique_checks);
SET @@unique_checks= 1;
INSERT INTO tstmt(num) VALUES (@@session.unique_checks);
SET @@auto_increment_increment= 11;
INSERT INTO tstmt(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_increment= 19;
INSERT INTO tstmt(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_offset= 13;
INSERT INTO tstmt(num) VALUES (@@session.auto_increment_offset);
SET @@auto_increment_offset= 17;
INSERT INTO tstmt(num) VALUES (@@session.auto_increment_offset);
SET @@auto_increment_increment= 1;
SET @@auto_increment_offset= 1;
SET @@character_set_client= 'cp1257';
INSERT INTO tstmt(text) VALUES (@@session.character_set_client);
SET @@character_set_client= 'cp1256';
INSERT INTO tstmt(text) VALUES (@@session.character_set_client);
SET @@collation_connection= 'cp1251_ukrainian_ci';
INSERT INTO tstmt(text) VALUES (@@session.collation_connection);
INSERT INTO tstmt(text) VALUES (@@session.character_set_connection);
SET @@collation_connection= 'cp1251_bulgarian_ci';
INSERT INTO tstmt(text) VALUES (@@session.collation_connection);
INSERT INTO tstmt(text) VALUES (@@session.character_set_connection);
SET @@collation_server= 'latin7_bin';
INSERT INTO tstmt(text) VALUES (@@session.collation_server);
INSERT INTO tstmt(text) VALUES (@@session.character_set_server);
SET @@collation_server= 'latin7_general_cs';
INSERT INTO tstmt(text) VALUES (@@session.collation_server);
INSERT INTO tstmt(text) VALUES (@@session.character_set_server);
SET @@time_zone= 'Europe/Moscow';
INSERT INTO tstmt(text) VALUES (@@session.time_zone);
SET @@time_zone= 'Universal';
INSERT INTO tstmt(text) VALUES (@@session.time_zone);
SET @@lc_time_names= 'sv_FI';
INSERT INTO tstmt(text) VALUES (@@session.lc_time_names);
SET @@lc_time_names= 'no_NO';
INSERT INTO tstmt(text) VALUES (@@session.lc_time_names);
SET @@collation_database= 'latin7_general_ci';
INSERT INTO tstmt(text) VALUES (@@session.collation_database);
INSERT INTO tstmt(text) VALUES (@@session.character_set_database);
SET @@collation_database= 'latin7_estonian_cs';
INSERT INTO tstmt(text) VALUES (@@session.collation_database);
INSERT INTO tstmt(text) VALUES (@@session.character_set_database);
SET @@timestamp= 47114711;
INSERT INTO tstmt(text) VALUES (@@session.timestamp);
SET @@timestamp= 47124712;
INSERT INTO tstmt(text) VALUES (@@session.timestamp);
SET @@last_insert_id= 1616;
INSERT INTO tstmt(text) VALUES (@@session.last_insert_id);
SET @@last_insert_id= 1717;
INSERT INTO tstmt(text) VALUES (@@session.last_insert_id);
==== Insert variables from a stored procedure ====
CREATE PROCEDURE proc()
BEGIN
SET @@pseudo_thread_id= 4712;
INSERT INTO tproc(num) VALUES (@@session.pseudo_thread_id);
SET @@pseudo_thread_id= 4713;
INSERT INTO tproc(num) VALUES (@@session.pseudo_thread_id);
SET @@foreign_key_checks= 0;
INSERT INTO tproc(num) VALUES (@@session.foreign_key_checks);
SET @@foreign_key_checks= 1;
INSERT INTO tproc(num) VALUES (@@session.foreign_key_checks);
SET @@sql_auto_is_null= 0;
INSERT INTO tproc(num) VALUES (@@session.sql_auto_is_null);
SET @@sql_auto_is_null= 1;
INSERT INTO tproc(num) VALUES (@@session.sql_auto_is_null);
SET @@unique_checks= 0;
INSERT INTO tproc(num) VALUES (@@session.unique_checks);
SET @@unique_checks= 1;
INSERT INTO tproc(num) VALUES (@@session.unique_checks);
SET @@auto_increment_increment= 11;
INSERT INTO tproc(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_increment= 19;
INSERT INTO tproc(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_offset= 13;
INSERT INTO tproc(num) VALUES (@@session.auto_increment_offset);
SET @@auto_increment_offset= 17;
INSERT INTO tproc(num) VALUES (@@session.auto_increment_offset);
# reset these as they affect the index column
SET @@auto_increment_increment= 1;
SET @@auto_increment_offset= 1;
SET @@character_set_client= 'cp1257';
INSERT INTO tproc(text) VALUES (@@session.character_set_client);
SET @@character_set_client= 'cp1256';
INSERT INTO tproc(text) VALUES (@@session.character_set_client);
SET @@collation_connection= 'cp1251_ukrainian_ci';
INSERT INTO tproc(text) VALUES (@@session.collation_connection);
INSERT INTO tproc(text) VALUES (@@session.character_set_connection);
SET @@collation_connection= 'cp1251_bulgarian_ci';
INSERT INTO tproc(text) VALUES (@@session.collation_connection);
INSERT INTO tproc(text) VALUES (@@session.character_set_connection);
SET @@collation_server= 'latin7_bin';
INSERT INTO tproc(text) VALUES (@@session.collation_server);
INSERT INTO tproc(text) VALUES (@@session.character_set_server);
SET @@collation_server= 'latin7_general_cs';
INSERT INTO tproc(text) VALUES (@@session.collation_server);
INSERT INTO tproc(text) VALUES (@@session.character_set_server);
SET @@time_zone= 'Europe/Moscow';
INSERT INTO tproc(text) VALUES (@@session.time_zone);
SET @@time_zone= 'Universal';
INSERT INTO tproc(text) VALUES (@@session.time_zone);
SET @@lc_time_names= 'sv_FI';
INSERT INTO tproc(text) VALUES (@@session.lc_time_names);
SET @@lc_time_names= 'no_NO';
INSERT INTO tproc(text) VALUES (@@session.lc_time_names);
SET @@collation_database= 'latin7_general_ci';
INSERT INTO tproc(text) VALUES (@@session.collation_database);
INSERT INTO tproc(text) VALUES (@@session.character_set_database);
SET @@collation_database= 'latin7_estonian_cs';
INSERT INTO tproc(text) VALUES (@@session.collation_database);
INSERT INTO tproc(text) VALUES (@@session.character_set_database);
SET @@timestamp= 47114711;
INSERT INTO tproc(text) VALUES (@@session.timestamp);
SET @@timestamp= 47124712;
INSERT INTO tproc(text) VALUES (@@session.timestamp);
SET @@last_insert_id= 1616;
INSERT INTO tproc(text) VALUES (@@session.last_insert_id);
SET @@last_insert_id= 1717;
INSERT INTO tproc(text) VALUES (@@session.last_insert_id);
END|
CALL proc();
==== Insert variables from a stored function ====
CREATE FUNCTION func()
RETURNS INT
BEGIN
SET @@pseudo_thread_id= 4712;
INSERT INTO tfunc(num) VALUES (@@session.pseudo_thread_id);
SET @@pseudo_thread_id= 4713;
INSERT INTO tfunc(num) VALUES (@@session.pseudo_thread_id);
SET @@foreign_key_checks= 0;
INSERT INTO tfunc(num) VALUES (@@session.foreign_key_checks);
SET @@foreign_key_checks= 1;
INSERT INTO tfunc(num) VALUES (@@session.foreign_key_checks);
SET @@sql_auto_is_null= 0;
INSERT INTO tfunc(num) VALUES (@@session.sql_auto_is_null);
SET @@sql_auto_is_null= 1;
INSERT INTO tfunc(num) VALUES (@@session.sql_auto_is_null);
SET @@unique_checks= 0;
INSERT INTO tfunc(num) VALUES (@@session.unique_checks);
SET @@unique_checks= 1;
INSERT INTO tfunc(num) VALUES (@@session.unique_checks);
SET @@auto_increment_increment= 11;
INSERT INTO tfunc(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_increment= 19;
INSERT INTO tfunc(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_offset= 13;
INSERT INTO tfunc(num) VALUES (@@session.auto_increment_offset);
SET @@auto_increment_offset= 17;
INSERT INTO tfunc(num) VALUES (@@session.auto_increment_offset);
# reset these as they affect the index column
SET @@auto_increment_increment= 1;
SET @@auto_increment_offset= 1;
SET @@character_set_client= 'cp1257';
INSERT INTO tfunc(text) VALUES (@@session.character_set_client);
SET @@character_set_client= 'cp1256';
INSERT INTO tfunc(text) VALUES (@@session.character_set_client);
SET @@collation_connection= 'cp1251_ukrainian_ci';
INSERT INTO tfunc(text) VALUES (@@session.collation_connection);
INSERT INTO tfunc(text) VALUES (@@session.character_set_connection);
SET @@collation_connection= 'cp1251_bulgarian_ci';
INSERT INTO tfunc(text) VALUES (@@session.collation_connection);
INSERT INTO tfunc(text) VALUES (@@session.character_set_connection);
SET @@collation_server= 'latin7_bin';
INSERT INTO tfunc(text) VALUES (@@session.collation_server);
INSERT INTO tfunc(text) VALUES (@@session.character_set_server);
SET @@collation_server= 'latin7_general_cs';
INSERT INTO tfunc(text) VALUES (@@session.collation_server);
INSERT INTO tfunc(text) VALUES (@@session.character_set_server);
SET @@time_zone= 'Europe/Moscow';
INSERT INTO tfunc(text) VALUES (@@session.time_zone);
SET @@time_zone= 'Universal';
INSERT INTO tfunc(text) VALUES (@@session.time_zone);
SET @@lc_time_names= 'sv_FI';
INSERT INTO tfunc(text) VALUES (@@session.lc_time_names);
SET @@lc_time_names= 'no_NO';
INSERT INTO tfunc(text) VALUES (@@session.lc_time_names);
SET @@collation_database= 'latin7_general_ci';
INSERT INTO tfunc(text) VALUES (@@session.collation_database);
INSERT INTO tfunc(text) VALUES (@@session.character_set_database);
SET @@collation_database= 'latin7_estonian_cs';
INSERT INTO tfunc(text) VALUES (@@session.collation_database);
INSERT INTO tfunc(text) VALUES (@@session.character_set_database);
SET @@timestamp= 47114711;
INSERT INTO tfunc(text) VALUES (@@session.timestamp);
SET @@timestamp= 47124712;
INSERT INTO tfunc(text) VALUES (@@session.timestamp);
SET @@last_insert_id= 1616;
INSERT INTO tfunc(text) VALUES (@@session.last_insert_id);
SET @@last_insert_id= 1717;
INSERT INTO tfunc(text) VALUES (@@session.last_insert_id);
RETURN 0;
END|
SELECT func();
func()
0
==== Insert variables from a trigger ====
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
FOR EACH ROW
BEGIN
SET @@pseudo_thread_id= 4712;
INSERT INTO ttrig(num) VALUES (@@session.pseudo_thread_id);
SET @@pseudo_thread_id= 4713;
INSERT INTO ttrig(num) VALUES (@@session.pseudo_thread_id);
SET @@foreign_key_checks= 0;
INSERT INTO ttrig(num) VALUES (@@session.foreign_key_checks);
SET @@foreign_key_checks= 1;
INSERT INTO ttrig(num) VALUES (@@session.foreign_key_checks);
SET @@sql_auto_is_null= 0;
INSERT INTO ttrig(num) VALUES (@@session.sql_auto_is_null);
SET @@sql_auto_is_null= 1;
INSERT INTO ttrig(num) VALUES (@@session.sql_auto_is_null);
SET @@unique_checks= 0;
INSERT INTO ttrig(num) VALUES (@@session.unique_checks);
SET @@unique_checks= 1;
INSERT INTO ttrig(num) VALUES (@@session.unique_checks);
SET @@auto_increment_increment= 11;
INSERT INTO ttrig(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_increment= 19;
INSERT INTO ttrig(num) VALUES (@@session.auto_increment_increment);
SET @@auto_increment_offset= 13;
INSERT INTO ttrig(num) VALUES (@@session.auto_increment_offset);
SET @@auto_increment_offset= 17;
INSERT INTO ttrig(num) VALUES (@@session.auto_increment_offset);
# reset these as they affect the index column
SET @@auto_increment_increment= 1;
SET @@auto_increment_offset= 1;
SET @@character_set_client= 'cp1257';
INSERT INTO ttrig(text) VALUES (@@session.character_set_client);
SET @@character_set_client= 'cp1256';
INSERT INTO ttrig(text) VALUES (@@session.character_set_client);
SET @@collation_connection= 'cp1251_ukrainian_ci';
INSERT INTO ttrig(text) VALUES (@@session.collation_connection);
INSERT INTO ttrig(text) VALUES (@@session.character_set_connection);
SET @@collation_connection= 'cp1251_bulgarian_ci';
INSERT INTO ttrig(text) VALUES (@@session.collation_connection);
INSERT INTO ttrig(text) VALUES (@@session.character_set_connection);
SET @@collation_server= 'latin7_bin';
INSERT INTO ttrig(text) VALUES (@@session.collation_server);
INSERT INTO ttrig(text) VALUES (@@session.character_set_server);
SET @@collation_server= 'latin7_general_cs';
INSERT INTO ttrig(text) VALUES (@@session.collation_server);
INSERT INTO ttrig(text) VALUES (@@session.character_set_server);
SET @@time_zone= 'Europe/Moscow';
INSERT INTO ttrig(text) VALUES (@@session.time_zone);
SET @@time_zone= 'Universal';
INSERT INTO ttrig(text) VALUES (@@session.time_zone);
SET @@lc_time_names= 'sv_FI';
INSERT INTO ttrig(text) VALUES (@@session.lc_time_names);
SET @@lc_time_names= 'no_NO';
INSERT INTO ttrig(text) VALUES (@@session.lc_time_names);
SET @@collation_database= 'latin7_general_ci';
INSERT INTO ttrig(text) VALUES (@@session.collation_database);
INSERT INTO ttrig(text) VALUES (@@session.character_set_database);
SET @@collation_database= 'latin7_estonian_cs';
INSERT INTO ttrig(text) VALUES (@@session.collation_database);
INSERT INTO ttrig(text) VALUES (@@session.character_set_database);
SET @@timestamp= 47114711;
INSERT INTO ttrig(text) VALUES (@@session.timestamp);
SET @@timestamp= 47124712;
INSERT INTO ttrig(text) VALUES (@@session.timestamp);
SET @@last_insert_id= 1616;
INSERT INTO ttrig(text) VALUES (@@session.last_insert_id);
SET @@last_insert_id= 1717;
INSERT INTO ttrig(text) VALUES (@@session.last_insert_id);
END|
INSERT INTO trigger_table VALUES ('bye.');
==== Insert variables from a prepared statement ====
PREPARE p1 FROM 'SET @@pseudo_thread_id= 4712';
PREPARE p2 FROM 'INSERT INTO tprep(num) VALUES (@@session.pseudo_thread_id)';
PREPARE p3 FROM 'SET @@pseudo_thread_id= 4713';
PREPARE p4 FROM 'INSERT INTO tprep(num) VALUES (@@session.pseudo_thread_id)';
PREPARE p5 FROM 'SET @@foreign_key_checks= 0';
PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@session.foreign_key_checks)';
PREPARE p7 FROM 'SET @@foreign_key_checks= 1';
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@session.foreign_key_checks)';
PREPARE p9 FROM 'SET @@sql_auto_is_null= 0';
PREPARE p10 FROM 'INSERT INTO tprep(num) VALUES (@@session.sql_auto_is_null)';
PREPARE p11 FROM 'SET @@sql_auto_is_null= 1';
PREPARE p12 FROM 'INSERT INTO tprep(num) VALUES (@@session.sql_auto_is_null)';
PREPARE p13 FROM 'SET @@unique_checks= 0';
PREPARE p14 FROM 'INSERT INTO tprep(num) VALUES (@@session.unique_checks)';
PREPARE p15 FROM 'SET @@unique_checks= 1';
PREPARE p16 FROM 'INSERT INTO tprep(num) VALUES (@@session.unique_checks)';
PREPARE p17 FROM 'SET @@auto_increment_increment= 11';
PREPARE p18 FROM 'INSERT INTO tprep(num) VALUES (@@session.auto_increment_increment)';
PREPARE p19 FROM 'SET @@auto_increment_increment= 19';
PREPARE p20 FROM 'INSERT INTO tprep(num) VALUES (@@session.auto_increment_increment)';
PREPARE p21 FROM 'SET @@auto_increment_offset= 13';
PREPARE p22 FROM 'INSERT INTO tprep(num) VALUES (@@session.auto_increment_offset)';
PREPARE p23 FROM 'SET @@auto_increment_offset= 17';
PREPARE p24 FROM 'INSERT INTO tprep(num) VALUES (@@session.auto_increment_offset)';
PREPARE p25 FROM 'SET @@auto_increment_increment= 1';
PREPARE p26 FROM 'SET @@auto_increment_offset= 1';
PREPARE p27 FROM 'SET @@character_set_client= \'cp1257\'';
PREPARE p28 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_client)';
PREPARE p29 FROM 'SET @@character_set_client= \'cp1256\'';
PREPARE p30 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_client)';
PREPARE p31 FROM 'SET @@collation_connection= \'cp1251_ukrainian_ci\'';
PREPARE p32 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_connection)';
PREPARE p33 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_connection)';
PREPARE p34 FROM 'SET @@collation_connection= \'cp1251_bulgarian_ci\'';
PREPARE p35 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_connection)';
PREPARE p36 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_connection)';
PREPARE p37 FROM 'SET @@collation_server= \'latin7_bin\'';
PREPARE p38 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_server)';
PREPARE p39 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_server)';
PREPARE p40 FROM 'SET @@collation_server= \'latin7_general_cs\'';
PREPARE p41 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_server)';
PREPARE p42 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_server)';
PREPARE p43 FROM 'SET @@time_zone= \'Europe/Moscow\'';
PREPARE p44 FROM 'INSERT INTO tprep(text) VALUES (@@session.time_zone)';
PREPARE p45 FROM 'SET @@time_zone= \'Universal\'';
PREPARE p46 FROM 'INSERT INTO tprep(text) VALUES (@@session.time_zone)';
PREPARE p47 FROM 'SET @@lc_time_names= \'sv_FI\'';
PREPARE p48 FROM 'INSERT INTO tprep(text) VALUES (@@session.lc_time_names)';
PREPARE p49 FROM 'SET @@lc_time_names= \'no_NO\'';
PREPARE p50 FROM 'INSERT INTO tprep(text) VALUES (@@session.lc_time_names)';
PREPARE p51 FROM 'SET @@collation_database= \'latin7_general_ci\'';
PREPARE p52 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_database)';
PREPARE p53 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_database)';
PREPARE p54 FROM 'SET @@collation_database= \'latin7_estonian_cs\'';
PREPARE p55 FROM 'INSERT INTO tprep(text) VALUES (@@session.collation_database)';
PREPARE p56 FROM 'INSERT INTO tprep(text) VALUES (@@session.character_set_database)';
PREPARE p57 FROM 'SET @@timestamp= 47114711';
PREPARE p58 FROM 'INSERT INTO tprep(text) VALUES (@@session.timestamp)';
PREPARE p59 FROM 'SET @@timestamp= 47124712';
PREPARE p60 FROM 'INSERT INTO tprep(text) VALUES (@@session.timestamp)';
PREPARE p61 FROM 'SET @@last_insert_id= 1616';
PREPARE p62 FROM 'INSERT INTO tprep(text) VALUES (@@session.last_insert_id)';
PREPARE p63 FROM 'SET @@last_insert_id= 1717';
PREPARE p64 FROM 'INSERT INTO tprep(text) VALUES (@@session.last_insert_id)';
EXECUTE p1;
EXECUTE p2;
EXECUTE p3;
EXECUTE p4;
EXECUTE p5;
EXECUTE p6;
EXECUTE p7;
EXECUTE p8;
EXECUTE p9;
EXECUTE p10;
EXECUTE p11;
EXECUTE p12;
EXECUTE p13;
EXECUTE p14;
EXECUTE p15;
EXECUTE p16;
EXECUTE p17;
EXECUTE p18;
EXECUTE p19;
EXECUTE p20;
EXECUTE p21;
EXECUTE p22;
EXECUTE p23;
EXECUTE p24;
EXECUTE p25;
EXECUTE p26;
EXECUTE p27;
EXECUTE p28;
EXECUTE p29;
EXECUTE p30;
EXECUTE p31;
EXECUTE p32;
EXECUTE p33;
EXECUTE p34;
EXECUTE p35;
EXECUTE p36;
EXECUTE p37;
EXECUTE p38;
EXECUTE p39;
EXECUTE p40;
EXECUTE p41;
EXECUTE p42;
EXECUTE p43;
EXECUTE p44;
EXECUTE p45;
EXECUTE p46;
EXECUTE p47;
EXECUTE p48;
EXECUTE p49;
EXECUTE p50;
EXECUTE p51;
EXECUTE p52;
EXECUTE p53;
EXECUTE p54;
EXECUTE p55;
EXECUTE p56;
EXECUTE p57;
EXECUTE p58;
EXECUTE p59;
EXECUTE p60;
EXECUTE p61;
EXECUTE p62;
EXECUTE p63;
EXECUTE p64;
==== Results ====
SELECT * FROM tstmt ORDER BY id;
id num text
1 4712 NULL
2 4713 NULL
3 0 NULL
4 1 NULL
5 0 NULL
6 1 NULL
7 0 NULL
8 1 NULL
12 11 NULL
20 19 NULL
32 13 NULL
36 17 NULL
37 NULL cp1257
38 NULL cp1256
39 NULL cp1251_ukrainian_ci
40 NULL cp1251
41 NULL cp1251_bulgarian_ci
42 NULL cp1251
43 NULL latin7_bin
44 NULL latin7
45 NULL latin7_general_cs
46 NULL latin7
47 NULL Europe/Moscow
48 NULL Universal
49 NULL sv_FI
50 NULL no_NO
51 NULL latin7_general_ci
52 NULL latin7
53 NULL latin7_estonian_cs
54 NULL latin7
55 NULL 47114711
56 NULL 47124712
57 NULL 1616
58 NULL 1717
Comparing tables master:test.tstmt and master:test.tproc
Comparing tables master:test.tstmt and master:test.tfunc
Comparing tables master:test.tstmt and master:test.ttrig
Comparing tables master:test.tstmt and master:test.tprep
Comparing tables master:test.tstmt and slave:test.tstmt
Comparing tables master:test.tstmt and slave:test.tproc
Comparing tables master:test.tstmt and slave:test.tfunc
Comparing tables master:test.tstmt and slave:test.ttrig
Comparing tables master:test.tstmt and slave:test.tprep
==== Clean up ====
[on master]
DROP PROCEDURE proc;
DROP FUNCTION func;
DROP TRIGGER trig;
DROP TABLE tstmt, tproc, tfunc, ttrig, tprep, trigger_table;
SET @@global.auto_increment_increment= @m_auto_increment_increment;
SET @@global.auto_increment_offset= @m_auto_increment_offset;
SET @@global.character_set_client= @m_character_set_client;
SET @@global.collation_connection= @m_collation_connection;
SET @@global.collation_server= @m_collation_server;
SET @@global.time_zone= @m_time_zone;
SET @@global.lc_time_names= @m_lc_time_names;
SET @@global.collation_database= @m_collation_database;
[on slave]
SET @@global.auto_increment_increment= @s_auto_increment_increment;
SET @@global.auto_increment_offset= @s_auto_increment_offset;
SET @@global.character_set_client= @s_character_set_client;
SET @@global.collation_connection= @s_collation_connection;
SET @@global.collation_server= @s_collation_server;
SET @@global.time_zone= @s_time_zone;
SET @@global.lc_time_names= @s_lc_time_names;
SET @@global.collation_database= @s_collation_database;
|