1 --source include/have_innodb.inc
2 --disable_abort_on_error
4 if (`SELECT HEX(@commands) = HEX(
'configure')`)
9 # Index that is used as an Id to tables that trigger errors.
11 --let $tt_error_counter=0
12 --let $nt_error_counter=0
15 # Creates a T-table that is never dropped.
17 --eval CREATE
TABLE tt_xx_1 (
id INT ) ENGINE = Innodb
20 # Creates a N-table that is never dropped.
22 --eval CREATE
TABLE nt_xx_1 (
id INT ) ENGINE = MyIsam
25 # Creates a T-table that is never dropped.
27 --eval CREATE
TABLE tt_error_1 (
id INT, PRIMARY
KEY (
id) ) ENGINE = Innodb
30 # Creates a N-table that is never dropped.
32 --eval CREATE
TABLE nt_error_1 (
id INT, PRIMARY
KEY (
id) ) ENGINE = MyIsam
35 # Creates a T-table that is never dropped.
37 --eval CREATE
TABLE tt_error_2 (
id INT, PRIMARY
KEY (
id) ) ENGINE = Innodb
40 # Creates a N-table that is never dropped.
42 --eval CREATE
TABLE nt_error_2 (
id INT, PRIMARY
KEY (
id) ) ENGINE = MyIsam
45 # Create a trigger nt_error_2 --> tt_error_2
48 CREATE TRIGGER tr_i_nt_2_to_tt_2 AFTER INSERT ON nt_error_2 FOR EACH ROW
50 DECLARE in_stmt_id INTEGER;
51 INSERT INTO tt_error_2(
id) VALUES (
NEW.
id);
56 # Creates a Temporary N-table that is never dropped.
58 --eval CREATE TEMPORARY
TABLE nt_tmp_xx_1 (
id INT ) ENGINE = MyIsam
61 # Creates a Temporary N-table that is never dropped.
63 --eval CREATE TEMPORARY
TABLE tt_tmp_xx_1 (
id INT ) ENGINE = Innodb
66 # In what follows, we create a set of tables that are used
67 # throughout this test case. The number of tables to be
68 # created is give by the variable $tot_table.
71 # Creates Temporay N-tables that are automatically dropped and recreated
72 # when a command ends.
77 --eval DROP TEMPORARY
TABLE IF EXISTS nt_tmp_$n
78 --eval CREATE TEMPORARY
TABLE nt_tmp_$n (
id INT ) ENGINE = MyIsam
80 --eval SET @check_temp=
'$available_n_temp'
83 # Updates the $available_n_temp that keeps track of the created
86 if (`SELECT HEX(@check_temp) != HEX(
'')`)
88 --let $available_n_temp= $available_n_temp,nt_tmp_$n
90 if (`SELECT HEX(@check_temp) = HEX(
'')`)
92 --let $available_n_temp= nt_tmp_$n
98 # Creates Temporay T-tables that are automatically dropped and recreated
99 # when a command ends.
104 --eval DROP TEMPORARY
TABLE IF EXISTS tt_tmp_$n
105 --eval CREATE TEMPORARY
TABLE tt_tmp_$n (
id INT ) ENGINE = Innodb
107 --eval SET @check_temp=
'$available_t_temp'
110 # Updates the $available_t_temp that keeps track of the created
111 # temporary T-tables.
113 if (`SELECT HEX(@check_temp) != HEX(
'')`)
115 --let $available_t_temp= $available_t_temp,tt_tmp_$n
117 if (`SELECT HEX(@check_temp) = HEX(
'')`)
119 --let $available_t_temp= tt_tmp_$n
125 # Creates N-tables that are automatically dropped and recreated
126 # when a command ends.
131 --eval DROP
TABLE IF EXISTS nt_$n
132 --eval CREATE
TABLE nt_$n (
id INT ) ENGINE = MyIsam
134 --eval SET @check_temp=
'$available_n'
137 # Updates the $available_n that keeps track of the created
140 if (`SELECT HEX(@check_temp) != HEX(
'')`)
142 --let $available_n= $available_n,nt_$n
144 if (`SELECT HEX(@check_temp) = HEX(
'')`)
146 --let $available_n= nt_$n
152 # Creates T-tables that are automatically dropped and recreated
153 # when a command ends.
158 --eval DROP
TABLE IF EXISTS tt_$n
159 --eval CREATE
TABLE tt_$n (
id INT ) ENGINE = Innodb
161 --eval SET @check_temp=
'$available_t'
164 # Updates the $available_t that keeps track of the created
167 if (`SELECT HEX(@check_temp) != HEX(
'')`)
169 --let $available_t= $available_t,tt_$n
171 if (`SELECT HEX(@check_temp) = HEX(
'')`)
173 --let $available_t= tt_$n
178 --let $dropped_t_temp=
179 --let $dropped_n_temp=
184 let $pos_trans_command= query_get_value(
"SHOW MASTER STATUS", Position, 1);
190 # Drops tables and synchronizes master and slave. Note that temporary
191 # tables are not explitcily dropped as they will be dropped while
192 # closing the connection.
194 if (`SELECT HEX(@commands) = HEX(
'clean')`)
198 DROP
TABLE IF EXISTS tt_xx_1;
200 DROP
TABLE IF EXISTS nt_xx_1;
202 DROP
TABLE IF EXISTS tt_error_1;
204 DROP
TABLE IF EXISTS nt_error_1;
206 DROP
TABLE IF EXISTS tt_error_2;
208 DROP
TABLE IF EXISTS nt_error_2;
213 --eval DROP
TABLE IF EXISTS nt_$n
220 --eval DROP
TABLE IF EXISTS tt_$n
224 sync_slave_with_master;
230 # This is the core of the test is responsible for processing
231 # the following commands:
238 # T - Inserts a row into a T-table
239 # N-Temp - Inserts a row into a temporary N-table.
242 # T-SELECT-N-Temp - Selects from a temporary N-table and inserts
244 # N-SELECT-N-Temp - Selects from a temporary N-table and inserts
246 # T-SELECT-T-Temp - Selects from a temporary T-table and inserts
248 # N-SELECT-T-Temp - Selects from a temporary T-table and inserts
252 # Create-N-Temp - Creates a temporary N-table if a temporary N-table
254 # Create-T-Temp - Creates a temporary T-table if a temporary T-table
258 # Drop-Temp-T-Temp - Drops a temporary T-table if there is any
259 # Drop-Temp-N-Temp - Drops a temporary N-table if there is any
260 # Drop-Temp-TN-Temp - Drops both a temporary T-table and N-table if there
262 # Drop-Temp-TT-Temp - Drops two temporary T-tables if there is any
263 # Drop-Temp-NN-Temp - Drops two temporary N-tables if there is any
264 # Drop-Temp-Xe-Temp - Tries to drop a temporary table that does not exist
265 # Drop-Temp-NXe-Temp - Drops a temporary N-table if there is any and
266 # a temporary table that does not exist
267 # Drop-Temp-TXe-Temp - Drops a temporary T-table if there is any and
268 # a temporary table that does not exist
271 # Drop-Temp-If-Xe-Temp - Tries to drop a temporary table that does not exist
272 # Drop-Temp-If-TXe-Temp - Drops a temporary T-table if there is any and
273 # a temporary table that does not exist
276 # Drop-T - Drops a T-table if there is any
277 # Drop-N - Drops a N-table if there is any
278 # Drop-Xe - Tries to drop a table that does not exist
279 # Drop-TXe - Drops a T-table if there is any and a table that does
281 # Drop-NXe - Drops a N-table if there is any and a table that does
283 # Drop-TN - Drops both a T-table and N-table if there is any
284 # Drop-TT - Drops two T-tables if there is any
285 # Drop-NN - Drops two N-tables if there is any
286 # Drop-N-TN-Temp - Drops a N-table and both a temporary T-table and
287 # N-table if there is any
290 # Drop-If-Xe - Tries to drop a table that does not exist
291 # Drop-If-TXe - Drops a T-table if there is any and a table that does
293 # Drop-If-NXe - Drops a N-table if there is any and a table that does
296 while (`SELECT HEX(@commands) != HEX(
'')`)
299 SET @command= SUBSTRING_INDEX(@commands,
' ', 1);
300 let $command= `SELECT @command`;
301 --eval SET @check_commands=
'$commands'
302 if (`SELECT HEX(@check_commands) = HEX(
'''')`)
304 let $commands= `SELECT @commands`;
307 if (`SELECT HEX(@command) = HEX('B
')`)
314 if (`SELECT HEX(@command) = HEX('T
')`)
317 eval INSERT INTO tt_xx_1() VALUES (1);
321 if (`SELECT HEX(@command) = HEX('N
')`)
324 eval INSERT INTO nt_xx_1() VALUES (1);
328 if (`SELECT HEX(@command) = HEX('Te
')`)
331 --inc $tt_error_counter
332 eval INSERT INTO tt_error_1() VALUES ($tt_error_counter), ($tt_error_counter);
336 if (`SELECT HEX(@command) = HEX('Ne
')`)
339 --inc $nt_error_counter
340 eval INSERT INTO nt_error_1() VALUES ($nt_error_counter), ($nt_error_counter);
344 if (`SELECT HEX(@command) = HEX('NeT-trig
')`)
347 --inc $nt_error_counter
348 eval INSERT INTO nt_error_1() VALUES ($nt_error_counter), ($nt_error_counter);
352 if (`SELECT HEX(@command) = HEX('N-Temp
')`)
355 eval INSERT INTO nt_tmp_xx_1() VALUES (1);
359 if (`SELECT HEX(@command) = HEX('N-SELECT-N-Temp
')`)
362 eval INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1;
366 if (`SELECT HEX(@command) = HEX('N-SELECT-T-Temp
')`)
369 eval INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1;
373 if (`SELECT HEX(@command) = HEX('T-SELECT-N-Temp
')`)
376 eval INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1;
380 if (`SELECT HEX(@command) = HEX('T-SELECT-T-Temp
')`)
383 eval INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1;
387 if (`SELECT HEX(@command) = HEX('Create-N-Temp
') || HEX(@command) = HEX('Create-T-Temp
')`)
389 if (`SELECT HEX(@command) = HEX('Create-N-Temp
')`)
391 --let $dropped_temp=$dropped_n_temp
392 --let $available_temp=$available_n_temp
394 if (`SELECT HEX(@command) = HEX('Create-T-Temp
')`)
396 --let $dropped_temp=$dropped_t_temp
397 --let $available_temp=$available_t_temp
400 --eval SET @check_temp='$dropped_temp
'
401 if (`SELECT HEX(@check_temp) != HEX('')`)
403 SET @temp= SUBSTRING_INDEX(@check_temp, ',
', 1);
404 let $table=`SELECT @temp`;
405 --eval SET @check_temp='$available_temp
'
406 if (`SELECT HEX(@check_temp) != HEX('')`)
408 --let $available_temp= $available_temp,$table
410 if (`SELECT HEX(@check_temp) = HEX('')`)
412 --let $available_temp= $table
414 --eval SET @check_temp='$dropped_temp
'
415 --eval SET @table_temp='$table
'
416 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
417 --let $dropped_temp= `SELECT @check_temp`
419 if (`SELECT HEX(@command) = HEX('Create-N-Temp
')`)
422 --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= MyIsam
425 --let $available_n_temp= $available_temp
426 --let $dropped_n_temp= $dropped_temp
428 if (`SELECT HEX(@command) = HEX('Create-T-Temp
')`)
431 --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= Innodb
434 --let $available_t_temp= $available_temp
435 --let $dropped_t_temp= $dropped_temp
440 if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp
') || HEX(@command) = HEX('Drop-Temp-T-Temp
') || HEX(@command) = HEX('Drop-T
') || HEX(@command) = HEX('Drop-N
')`)
442 if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp
')`)
444 --let $dropped_temp=$dropped_n_temp
445 --let $available_temp=$available_n_temp
447 if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp
')`)
449 --let $dropped_temp=$dropped_t_temp
450 --let $available_temp=$available_t_temp
452 if (`SELECT HEX(@command) = HEX('Drop-N
')`)
454 --let $dropped_temp=$dropped_n
455 --let $available_temp=$available_n
457 if (`SELECT HEX(@command) = HEX('Drop-T
')`)
459 --let $dropped_temp=$dropped_t
460 --let $available_temp=$available_t
463 --eval SET @check_temp='$available_temp
'
464 if (`SELECT HEX(@check_temp) != HEX('')`)
466 SET @temp= SUBSTRING_INDEX(@check_temp, ',
', 1);
467 let $table=`SELECT @temp`;
468 --eval SET @check_temp='$dropped_temp
'
469 if (`SELECT HEX(@check_temp) != HEX('')`)
471 --let $dropped_temp= $dropped_temp,$table
473 if (`SELECT HEX(@check_temp) = HEX('')`)
475 --let $dropped_temp= $table
477 --eval SET @check_temp='$available_temp
'
478 --eval SET @table_temp='$table
'
479 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
480 --let $available_temp= `SELECT @check_temp`
482 if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp
')`)
485 --eval DROP TEMPORARY TABLE $table
488 --let $available_n_temp= $available_temp
489 --let $dropped_n_temp= $dropped_temp
491 if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp
')`)
494 --eval DROP TEMPORARY TABLE $table
497 --let $available_t_temp= $available_temp
498 --let $dropped_t_temp= $dropped_temp
500 if (`SELECT HEX(@command) = HEX('Drop-N
')`)
503 --eval DROP TABLE $table
506 --let $available_n= $available_temp
507 --let $dropped_n= $dropped_temp
509 if (`SELECT HEX(@command) = HEX('Drop-T
')`)
512 --eval DROP TABLE $table
515 --let $available_t= $available_temp
516 --let $dropped_t= $dropped_temp
521 if (`SELECT HEX(@command) = HEX('Drop-Temp-Xe-Temp
')`)
524 --eval DROP TEMPORARY TABLE tt_xx_1
528 if (`SELECT HEX(@command) = HEX('Drop-Temp-If-Xe-Temp
')`)
531 --eval DROP TEMPORARY TABLE IF EXISTS tt_xx_1
535 if (`SELECT HEX(@command) = HEX('Drop-Xe
')`)
538 --eval DROP TABLE xx_1
542 if (`SELECT HEX(@command) = HEX('Drop-If-Xe
')`)
545 --eval DROP TABLE IF EXISTS xx_1
549 if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp
') || HEX(@command) = HEX('Drop-Temp-TXe-Temp
') || HEX(@command) = HEX('Drop-NXe
') || HEX(@command) = HEX('Drop-TXe
') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp
') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp
') || HEX(@command) = HEX('Drop-If-NXe
') || HEX(@command) = HEX('Drop-If-TXe
')`)
551 if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp
') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp
')`)
553 --let $dropped_temp=$dropped_n_temp
554 --let $available_temp=$available_n_temp
556 if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp
') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp
')`)
558 --let $dropped_temp=$dropped_t_temp
559 --let $available_temp=$available_t_temp
561 if (`SELECT HEX(@command) = HEX('Drop-NXe
') || HEX(@command) = HEX('Drop-If-NXe
')`)
563 --let $dropped_temp=$dropped_n
564 --let $available_temp=$available_n
566 if (`SELECT HEX(@command) = HEX('Drop-TXe
') || HEX(@command) = HEX('Drop-If-TXe
')`)
568 --let $dropped_temp=$dropped_t
569 --let $available_temp=$available_t
572 --eval SET @check_temp='$available_temp
'
573 if (`SELECT HEX(@check_temp) != HEX('')`)
575 SET @temp= SUBSTRING_INDEX(@check_temp, ',
', 1);
576 let $table=`SELECT @temp`;
577 --eval SET @check_temp='$dropped_temp
'
578 if (`SELECT HEX(@check_temp) != HEX('')`)
580 --let $dropped_temp= $dropped_temp,$table
582 if (`SELECT HEX(@check_temp) = HEX('')`)
584 --let $dropped_n_temp= $table
586 --eval SET @check_temp='$available_temp
'
587 --eval SET @table_temp='$table
'
588 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
589 --let $available_temp= `SELECT @check_temp`
591 if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp
')`)
594 --eval DROP TEMPORARY TABLE $table, tt_1
597 --let $available_n_temp= $available_temp
598 --let $dropped_n_temp= $dropped_temp
600 if (`SELECT HEX(@command) = HEX('Drop-Temp-If-NXe-Temp
')`)
603 --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1
606 --let $available_n_temp= $available_temp
607 --let $dropped_n_temp= $dropped_temp
609 if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp
')`)
612 --eval DROP TEMPORARY TABLE $table, tt_1
615 --let $available_t_temp= $available_temp
616 --let $dropped_t_temp= $dropped_temp
618 if (`SELECT HEX(@command) = HEX('Drop-Temp-If-TXe-Temp
')`)
621 --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1
624 --let $available_t_temp= $available_temp
625 --let $dropped_t_temp= $dropped_temp
627 if (`SELECT HEX(@command) = HEX('Drop-NXe
')`)
630 --eval DROP TABLE $table, xx_1
633 --let $available_n= $available_temp
634 --let $dropped_n= $dropped_temp
636 if (`SELECT HEX(@command) = HEX('Drop-If-NXe
')`)
639 --eval DROP TABLE IF EXISTS $table, xx_1
642 --let $available_n= $available_temp
643 --let $dropped_n= $dropped_temp
645 if (`SELECT HEX(@command) = HEX('Drop-TXe
')`)
648 --eval DROP TABLE $table, xx_1
651 --let $available_t= $available_temp
652 --let $dropped_t= $dropped_temp
654 if (`SELECT HEX(@command) = HEX('Drop-If-TXe
')`)
657 --eval DROP TABLE IF EXISTS $table, xx_1
660 --let $available_t= $available_temp
661 --let $dropped_t= $dropped_temp
666 if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp
') || HEX(@command) = HEX('Drop-Temp-TT-Temp
') || HEX(@command) = HEX('Drop-NN
') || HEX(@command) = HEX('Drop-TT
')`)
668 if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp
')`)
670 --let $dropped_temp=$dropped_n_temp
671 --let $available_temp=$available_n_temp
673 if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp
')`)
675 --let $dropped_temp=$dropped_t_temp
676 --let $available_temp=$available_t_temp
678 if (`SELECT HEX(@command) = HEX('Drop-NN
')`)
680 --let $dropped_temp=$dropped_n
681 --let $available_temp=$available_n
683 if (`SELECT HEX(@command) = HEX('Drop-TT
')`)
685 --let $dropped_temp=$dropped_t
686 --let $available_temp=$available_t
689 --eval SET @check_temp='$available_temp
'
690 if (`SELECT HEX(@check_temp) != HEX('')`)
693 while (`SELECT HEX(@check_temp) != HEX('') && $n != 0`)
695 SET @temp= SUBSTRING_INDEX(@check_temp, ',
', 1);
696 let $table=`SELECT @temp`;
697 --eval SET @check_temp='$dropped_temp
'
698 if (`SELECT HEX(@check_temp) != HEX('')`)
700 --let $dropped_temp= $dropped_temp,$table
702 if (`SELECT HEX(@check_temp) = HEX('')`)
704 --let $dropped_temp= $table
708 --let $table_1= $table
712 --let $table_2= $table
716 --eval SET @check_temp='$available_temp
'
717 --eval SET @table_temp='$table
'
718 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
719 --let $available_temp= `SELECT @check_temp`
722 if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp
') && $n = 0`)
725 --eval DROP TEMPORARY TABLE $table_1, $table_2
728 --let $available_n_temp= $available_temp
729 --let $dropped_n_temp= $dropped_temp
731 if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp
') && $n= 0`)
734 --eval DROP TEMPORARY TABLE $table_1, $table_2
737 --let $available_t_temp= $available_temp
738 --let $dropped_t_temp= $dropped_temp
740 if (`SELECT HEX(@command) = HEX('Drop-NN
') && $n = 0`)
743 --eval DROP TABLE $table_1, $table_2
746 --let $available_n= $available_temp
747 --let $dropped_n= $dropped_temp
749 if (`SELECT HEX(@command) = HEX('Drop-TT
') && $n= 0`)
752 --eval DROP TABLE $table_1, $table_2
755 --let $available_t= $available_temp
756 --let $dropped_t= $dropped_temp
761 if (`SELECT HEX(@command) = HEX('Drop-Temp-TN-Temp
')`)
763 --eval SET @check_temp_t='$available_t_temp
'
764 --eval SET @check_temp_n='$available_n_temp
'
765 if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`)
767 SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',
', 1);
768 let $table_t=`SELECT @temp_t`;
769 --eval SET @check_temp_t='$dropped_t_temp
'
770 if (`SELECT HEX(@check_temp_t) != HEX('')`)
772 --let $dropped_t_temp= $dropped_t_temp,$table_t
774 if (`SELECT HEX(@check_temp_t) = HEX('')`)
776 --let $dropped_t_temp= $table_t
778 --eval SET @check_temp='$available_t_temp
'
779 --eval SET @table_temp='$table_t
'
780 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
781 --let $available_t_temp= `SELECT @check_temp`
783 SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',
', 1);
784 let $table_n=`SELECT @temp_n`;
785 --eval SET @check_temp_n='$dropped_n_temp
'
786 if (`SELECT HEX(@check_temp_n) != HEX('')`)
788 --let $dropped_n_temp= $dropped_n_temp,$table_n
790 if (`SELECT HEX(@check_temp_n) = HEX('')`)
792 --let $dropped_n_temp= $table_n
794 --eval SET @check_temp='$available_n_temp
'
795 --eval SET @table_temp='$table_n
'
796 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
797 --let $available_n_temp= `SELECT @check_temp`
800 --eval DROP TEMPORARY TABLE $table_t, $table_n
805 if (`SELECT HEX(@command) = HEX('Drop-TN
')`)
807 --eval SET @check_temp_t='$available_t
'
808 --eval SET @check_temp_n='$available_n
'
809 if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`)
811 SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',
', 1);
812 let $table_t=`SELECT @temp_t`;
813 --eval SET @check_temp_t='$dropped_t
'
814 if (`SELECT HEX(@check_temp_t) != HEX('')`)
816 --let $dropped_t= $dropped_t,$table_t
818 if (`SELECT HEX(@check_temp_t) = HEX('')`)
820 --let $dropped_t= $table_t
822 --eval SET @check_temp='$available_t
'
823 --eval SET @table_temp='$table_t
'
824 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
825 --let $available_t= `SELECT @check_temp`
827 SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',
', 1);
828 let $table_n=`SELECT @temp_n`;
829 --eval SET @check_temp_n='$dropped_n
'
830 if (`SELECT HEX(@check_temp_n) != HEX('')`)
832 --let $dropped_n= $dropped_n,$table_n
834 if (`SELECT HEX(@check_temp_n) = HEX('')`)
836 --let $dropped_n= $table_n
838 --eval SET @check_temp='$available_n
'
839 --eval SET @table_temp='$table_n
'
840 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
841 --let $available_t= `SELECT @check_temp`
844 --eval DROP TABLE $table_t, $table_n
849 if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp
') || HEX(@command) = HEX('Drop-TN-Temp
')`)
851 --eval SET @check_temp_t='$available_t_temp
'
852 --eval SET @check_temp_n='$available_n_temp
'
853 if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp
')`)
855 --eval SET @check_n='$available_n
'
857 if (`SELECT HEX(@command) = HEX('Drop-TN-Temp
')`)
860 # Just to be possible to go through the next if...
862 --eval SET @check_n='...
'
864 if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('') && HEX(@check_n) != HEX('')`)
866 SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',
', 1);
867 let $table_temp_t=`SELECT @temp_t`;
868 --eval SET @check_temp_t='$dropped_t_temp
'
869 if (`SELECT HEX(@check_temp_t) != HEX('')`)
871 --let $dropped_t_temp= $dropped_t_temp,$table_temp_t
873 if (`SELECT HEX(@check_temp_t) = HEX('')`)
875 --let $dropped_t_temp= $table_temp_t
877 --eval SET @check_temp='$available_t_temp
'
878 --eval SET @table_temp='$table_temp_t
'
879 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
880 --let $available_t_temp= `SELECT @check_temp`
882 SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',
', 1);
883 let $table_temp_n=`SELECT @temp_n`;
884 --eval SET @check_temp_n='$dropped_n_temp
'
885 if (`SELECT HEX(@check_temp_n) != HEX('')`)
887 --let $dropped_n_temp= $dropped_n_temp,$table_temp_n
889 if (`SELECT HEX(@check_temp_n) = HEX('')`)
891 --let $dropped_n_temp= $table_temp_n
893 --eval SET @check_temp='$available_n_temp
'
894 --eval SET @table_temp='$table_temp_n
'
895 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
896 --let $available_n_temp= `SELECT @check_temp`
898 if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp
')`)
900 SET @temp_n= SUBSTRING_INDEX(@check_n, ',
', 1);
901 let $table_n=`SELECT @temp_n`;
902 --eval SET @check_n='$dropped_n
'
903 if (`SELECT HEX(@check_n) != HEX('')`)
905 --let $dropped_n= $dropped_n,$table_n
907 if (`SELECT HEX(@check_n) = HEX('')`)
909 --let $dropped_n= $table_n
911 --eval SET @check_temp='$available_n
'
912 --eval SET @table_temp='$table_n
'
913 SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
914 --let $available_n= `SELECT @check_temp`
917 --eval DROP TABLE $table_temp_t, $table_temp_n, $table_n
920 if (`SELECT HEX(@command) = HEX('Drop-TN-Temp
')`)
923 --eval DROP TABLE $table_temp_t, $table_temp_n
929 if (`SELECT HEX(@command) = HEX('C
')`)
932 --error 0, ER_GET_ERRMSG
937 if (`SELECT HEX(@command) = HEX('R
')`)
940 --error 0, ER_GET_ERRMSG
946 SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1));
947 if (`SELECT HEX(@commands) = HEX('')`)
949 let $binlog_start= $pos_trans_command;
950 --echo -b-b-b-b-b-b-b-b-b-b-b- >> $commands << -b-b-b-b-b-b-b-b-b-b-b-
951 # Use other connection because include/show_binlog_events.inc
952 # executes SELECT UUID(), which switches to row-logging when
953 # binlog_format=mixed, if there are open temporary tables. This is
954 # due to BUG#13692513.
955 --connection server_1
956 --source include/show_binlog_events.inc
958 --echo -e-e-e-e-e-e-e-e-e-e-e- >> $commands << -e-e-e-e-e-e-e-e-e-e-e-
962 --let $available_n_temp=
963 --let $dropped_n_temp=
967 --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
968 --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam
969 --eval SET @check_temp='$available_n_temp
'
970 if (`SELECT HEX(@check_temp) != HEX('')`)
972 --let $available_n_temp= $available_n_temp,nt_tmp_$n
974 if (`SELECT HEX(@check_temp) = HEX('')`)
976 --let $available_n_temp= nt_tmp_$n
981 --let $available_t_temp=
982 --let $dropped_t_temp=
986 --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
987 --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb
988 --eval SET @check_temp='$available_t_temp
'
989 if (`SELECT HEX(@check_temp) != HEX('')`)
991 --let $available_t_temp= $available_t_temp,tt_tmp_$n
993 if (`SELECT HEX(@check_temp) = HEX('')`)
995 --let $available_t_temp= tt_tmp_$n
1002 --let $n= $tot_table
1005 --eval DROP TABLE IF EXISTS tt_$n
1006 --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb
1007 --eval SET @check_temp='$available_t
'
1008 if (`SELECT HEX(@check_temp) != HEX('')`)
1010 --let $available_t= $available_t,tt_$n
1012 if (`SELECT HEX(@check_temp) = HEX('')`)
1014 --let $available_t= tt_$n
1021 --let $n= $tot_table
1024 --eval DROP TABLE IF EXISTS nt_$n
1025 --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam
1026 --eval SET @check_temp='$available_n
'
1027 if (`SELECT HEX(@check_temp) != HEX('')`)
1029 --let $available_n= $available_n,nt_$n
1031 if (`SELECT HEX(@check_temp) = HEX('')`)
1033 --let $available_n= nt_$n
1039 let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);