3 # This is an auxiliary file used by rpl_mixing_engines.test. It
4 # executes SQL statements according to a format string, as specified in
5 # rpl_mixing_engines.test. In addition, it accepts the special format
6 # strings 'configure' and 'clean', used before and after everything else.
10 # --let $commands= command1 command2 ...
11 # --let $database_name= name
13 # --source include/rpl_mixing_engines.inc
18 # Space-separated list of commands. See rpl_mixing_engines.test
19 # for a list of all commands.
22 # Name of database to use. If $commands is 'configure' or
23 # 'clean', and the database name is not 'test', then the
24 # database is created or dropped, respectively.
27 # By default, show_binlog_events.inc is sourced after all
28 # commands have been processed, showing the result of all
29 # commands. If this flag is set, then show_binlog_events.inc is
30 # also sourced once after each command, showing only the result
33 --echo rpl_mixing_engines.inc [commands=$commands]
35 --let $rme_initial_commands= $commands
37 if ($commands ==
'configure')
42 if ($database_name !=
'test')
44 --eval CREATE DATABASE $database_name
46 --eval use $database_name
49 eval CREATE
TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
50 eval CREATE
TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
51 eval CREATE
TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
52 eval CREATE
TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
53 eval CREATE
TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
54 eval CREATE
TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = MyISAM;
55 eval CREATE
TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
56 eval CREATE
TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
57 eval CREATE
TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
58 eval CREATE
TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
59 eval CREATE
TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
60 eval CREATE
TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY
KEY(trans_id, stmt_id)) ENGINE = $engine_type;
62 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
63 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
64 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
65 INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
66 INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
67 INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
69 INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
70 INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
71 INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
72 INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
73 INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
74 INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
78 CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
80 DECLARE in_stmt_id INTEGER;
81 SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
82 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
83 INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
84 INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
87 CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
89 DECLARE in_stmt_id INTEGER;
90 SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
91 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
92 INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
93 INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
96 CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
98 DECLARE in_stmt_id INTEGER;
99 SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
100 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
101 INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
102 INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
103 RETURN "fc_i_tt_5_suc";
106 CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
108 DECLARE in_stmt_id INTEGER;
109 SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
110 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
111 INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
112 INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
113 RETURN "fc_i_nt_5_suc";
116 CREATE FUNCTION fc_i_nt_3_tt_3_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
118 DECLARE in_stmt_id INTEGER;
119 SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= p_trans_id;
120 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
121 INSERT INTO nt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
123 SELECT max(stmt_id) INTO in_stmt_id FROM tt_3 WHERE trans_id= p_trans_id;
124 SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
125 INSERT INTO tt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
126 RETURN "fc_i_nt_3_tt_3_suc";
129 CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
131 DECLARE in_stmt_id INTEGER;
132 SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id=
NEW.trans_id;
133 SELECT COALESCE(greatest(in_stmt_id + 1,
NEW.stmt_id), 1) INTO in_stmt_id;
134 INSERT INTO nt_3(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id);
135 INSERT INTO nt_3(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id + 1);
138 CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
140 DECLARE in_stmt_id INTEGER;
141 SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id=
NEW.trans_id;
142 SELECT COALESCE(greatest(in_stmt_id + 1,
NEW.stmt_id), 1) INTO in_stmt_id;
143 INSERT INTO tt_4(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id);
144 INSERT INTO tt_4(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id + 1);
147 CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
149 DECLARE in_stmt_id INTEGER;
150 SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id=
NEW.trans_id;
151 SELECT COALESCE(greatest(in_stmt_id + 1,
NEW.stmt_id, 1), 1) INTO in_stmt_id;
152 INSERT INTO tt_6(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id);
153 INSERT INTO tt_6(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id + 1);
156 CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
158 DECLARE in_stmt_id INTEGER;
159 SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id=
NEW.trans_id;
160 SELECT COALESCE(greatest(in_stmt_id + 1,
NEW.stmt_id), 1) INTO in_stmt_id;
161 INSERT INTO nt_6(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id);
162 INSERT INTO nt_6(trans_id, stmt_id) VALUES (
NEW.trans_id, in_stmt_id + 1);
167 let $pos_trans_command= query_get_value("SHOW MASTER
STATUS", Position, 1);
176 if ($commands == 'clean')
181 --eval use $database_name
198 DROP PROCEDURE pc_i_tt_5_suc;
199 DROP PROCEDURE pc_i_nt_5_suc;
200 DROP FUNCTION fc_i_tt_5_suc;
201 DROP FUNCTION fc_i_nt_5_suc;
202 DROP FUNCTION fc_i_nt_3_tt_3_suc;
205 if ($database_name !=
'test')
207 --eval DROP DATABASE $database_name
211 sync_slave_with_master;
216 while ($commands !=
'')
219 --eval use $database_name
223 --let $command= `SELECT SUBSTRING_INDEX(
'$commands',
' ', 1)`
226 --echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b-
227 let $pos_command= query_get_value(
"SHOW MASTER STATUS", Position, 1);
236 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
237 eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
240 if ($command == 'T-trig')
242 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
243 eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
246 if ($command == 'T-func')
248 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
249 eval SELECT fc_i_tt_5_suc ($trans_id, $stmt_id);
252 if ($command ==
'T-proc')
254 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
255 eval CALL pc_i_tt_5_suc ($trans_id, $stmt_id);
258 if ($command ==
'eT')
260 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
261 let $old_trans_id= `SELECT max(trans_id) from tt_1`;
262 let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
263 --error ER_DUP_ENTRY, ER_DUP_KEY
264 eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
267 if ($command == 'Te')
269 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
270 let $old_trans_id= `SELECT max(trans_id) from tt_1`;
271 let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
272 --error ER_DUP_ENTRY, ER_DUP_KEY
273 eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
276 if ($command == 'Te-trig')
278 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
279 let $old_trans_id= `SELECT max(trans_id) from tt_5`;
280 let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
281 --error ER_DUP_ENTRY, ER_DUP_KEY
282 eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
285 if ($command == 'Te-func')
287 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
288 let $old_trans_id= `SELECT max(trans_id) from tt_1`;
289 let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
290 --error ER_DUP_ENTRY, ER_DUP_KEY
291 eval INSERT INTO tt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
296 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
297 eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
300 if ($command == 'N-trig')
302 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
303 eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
306 if ($command == 'N-func')
308 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
309 eval SELECT fc_i_nt_5_suc ($trans_id, $stmt_id);
312 if ($command ==
'N-proc')
314 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
315 eval CALL pc_i_nt_5_suc ($trans_id, $stmt_id);
318 if ($command ==
'eN')
320 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
321 let $old_trans_id= `SELECT max(trans_id) from nt_1`;
322 let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
323 --error ER_DUP_ENTRY, ER_DUP_KEY
324 eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
327 if ($command == 'Ne')
329 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
330 let $old_trans_id= `SELECT max(trans_id) from nt_1`;
331 let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
332 --error ER_DUP_ENTRY, ER_DUP_KEY
333 eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
336 if ($command == 'Ne-trig')
338 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
339 let $old_trans_id= `SELECT max(trans_id) from nt_5`;
340 let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
341 --error ER_DUP_ENTRY, ER_DUP_KEY
342 eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
345 if ($command == 'Ne-func')
347 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
348 let $old_trans_id= `SELECT max(trans_id) from nt_1`;
349 let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
350 --error ER_DUP_ENTRY, ER_DUP_KEY
351 eval INSERT INTO nt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
354 if ($command == 'tN')
356 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
357 eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1;
360 if ($command == 'tNe')
362 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
363 let $old_trans_id= `SELECT max(trans_id) from nt_1`;
364 let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
365 --error ER_DUP_ENTRY, ER_DUP_KEY
366 eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM tt_1;
369 if ($command == 'nT')
371 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
372 eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1;
375 if ($command == 'nTe')
377 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
378 let $old_trans_id= `SELECT max(trans_id) from tt_1`;
379 let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
380 --error ER_DUP_ENTRY, ER_DUP_KEY
381 eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM nt_1;
384 if ($command == 'NT')
386 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
387 eval UPDATE nt_3, tt_3 SET nt_3.info=
"new text $trans_id --> $stmt_id", tt_3.info=
"new text $trans_id --> $stmt_id" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1;
390 if ($command ==
'NT-trig')
392 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
393 eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
396 if ($command == 'NT-func')
398 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
399 eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_tt_5_suc($trans_id, $stmt_id));
402 if ($command == 'NeT-trig')
404 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
405 let $old_trans_id= `SELECT max(trans_id) from nt_4`;
406 let $old_stmt_id= `SELECT max(stmt_id) from nt_4 where trans_id= $old_trans_id`;
407 --error ER_DUP_ENTRY, ER_DUP_KEY
408 eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
411 if ($command == 'NeT-func')
413 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
414 let $old_trans_id= `SELECT max(trans_id) from nt_5`;
415 let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
416 --error ER_DUP_ENTRY, ER_DUP_KEY
417 eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
420 if ($command == 'TN')
422 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
423 eval UPDATE tt_4, nt_4 SET tt_4.info=
"new text $trans_id --> $stmt_id", nt_4.info=
"new text $trans_id --> $stmt_id" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1;
426 if ($command ==
'TN-trig')
428 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
429 eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
432 if ($command == 'TN-func')
434 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
435 eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_nt_5_suc($trans_id, $stmt_id));
438 if ($command == 'TeN-trig')
440 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
441 let $old_trans_id= `SELECT max(trans_id) from tt_3`;
442 let $old_stmt_id= `SELECT max(stmt_id) from tt_3 where trans_id= $old_trans_id`;
443 --error ER_DUP_ENTRY, ER_DUP_KEY
444 eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
447 if ($command == 'TeN-func')
449 #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
450 let $old_trans_id= `SELECT max(trans_id) from tt_5`;
451 let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
452 --error ER_DUP_ENTRY, ER_DUP_KEY
453 eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
456 if ($command == 'set-T')
458 --eval SET @var= fc_i_tt_5_suc($trans_id, $stmt_id)
461 if ($command == 'set-N')
463 --eval SET @var= fc_i_nt_5_suc($trans_id, $stmt_id)
466 if ($command == 'set-NT')
468 --eval SET @var= fc_i_nt_3_tt_3_suc($trans_id, $stmt_id)
471 if ($command == 'CS-T->T')
473 --eval CREATE
TABLE tt_xx_$tb_id (PRIMARY
KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM tt_1;
475 if ($command == 'CS-N->N')
477 --eval CREATE
TABLE nt_xx_$tb_id (PRIMARY
KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;
479 if ($command == 'CS-T->N')
481 --eval CREATE
TABLE tt_xx_$tb_id (PRIMARY
KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM nt_1;
483 if ($command == 'CS-N->T')
485 --eval CREATE
TABLE nt_xx_$tb_id (PRIMARY
KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;
487 if ($command == 'CSe-T->T')
489 --error ER_DUP_ENTRY, ER_DUP_KEY
490 --eval CREATE
TABLE tt_xx_$tb_id (PRIMARY
KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1;
492 if ($command == 'CSe-N->N')
494 --error ER_DUP_ENTRY, ER_DUP_KEY
495 --eval CREATE
TABLE nt_xx_$tb_id (PRIMARY
KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;
497 if ($command == 'CSe-T->N')
499 --error ER_DUP_ENTRY, ER_DUP_KEY
500 --eval CREATE
TABLE tt_xx_$tb_id (PRIMARY
KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1;
502 if ($command == 'CSe-N->T')
504 --error ER_DUP_ENTRY, ER_DUP_KEY
505 --eval CREATE
TABLE nt_xx_$tb_id (PRIMARY
KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;
507 if ($command == 'CT')
509 --eval CREATE TEMPORARY
TABLE tt_xx_$tb_id (a
int) engine=$engine_type;
511 if ($command ==
'IS-T<-N')
513 --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
515 if ($command == 'ISe-T<-N')
517 --error ER_DUP_ENTRY, ER_DUP_KEY
518 --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
520 if ($command == 'IS-N<-T')
522 --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
524 if ($command == 'ISe-N<-T')
526 --error ER_DUP_ENTRY, ER_DUP_KEY
527 --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
529 if ($command == 'IS-T<-T')
531 --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
533 if ($command == 'ISe-T<-T')
535 --error ER_DUP_ENTRY, ER_DUP_KEY
536 --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
538 if ($command == 'IS-N<-N')
540 --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
542 if ($command == 'ISe-N<-N')
544 --error ER_DUP_ENTRY, ER_DUP_KEY
545 --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
547 if ($command == 'trunc-CS-T')
549 eval TRUNCATE
TABLE tt_xx_$tb_id;
551 if ($command ==
'trunc-CS-N')
553 eval TRUNCATE
TABLE nt_xx_$tb_id;
555 if ($command ==
'trunc-CT')
557 eval TRUNCATE
TABLE tt_xx_$tb_id;
559 if ($command ==
'drop-CS')
562 eval DROP
TABLE IF EXISTS tt_xx_$tb_id, nt_xx_$tb_id;
566 if ($command ==
'drop-CT')
569 eval DROP TEMPORARY
TABLE IF EXISTS tt_xx_$tb_id;
575 --error 0, ER_GET_ERRMSG
581 --error 0, ER_GET_ERRMSG
584 if ($command ==
'Sn')
586 eval SAVEPOINT S_$sn;
589 if ($command ==
'Rn')
596 eval ROLLBACK TO S_$sn;
598 if ($command ==
'Cn')
604 eval RELEASE SAVEPOINT S_$sn;
607 --let $commands= `SELECT LTRIM(SUBSTRING(
'$commands', LENGTH(
'$command') + 1))`
610 let $binlog_start= $pos_command;
613 # Use other connection because include/show_binlog_events.inc
614 # executes SELECT UUID(), which switches to row-logging when
615 # binlog_format=mixed, if there are open temporary tables. This is
616 # due to BUG#13692513.
617 --connection server_1
618 --source include/show_binlog_events.inc
620 --echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e-
624 let $binlog_start= $pos_trans_command;
625 --echo -b-b-b-b-b-b-b-b-b-b-b- >> $rme_initial_commands << -b-b-b-b-b-b-b-b-b-b-b-
626 --connection server_1
627 --source include/show_binlog_events.inc
629 --echo -e-e-e-e-e-e-e-e-e-e-e- >> $rme_initial_commands << -e-e-e-e-e-e-e-e-e-e-e-
631 let $pos_trans_command= query_get_value(
"SHOW MASTER STATUS", Position, 1);
637 --let $commands= $rme_initial_commands