mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / extra / binlog_tests / binlog_truncate.test
blobdce33b3cef0e98ce3972ec7ec5a4e7e6c4344d51
1 # BUG #36763: TRUNCATE TABLE fails to replicate when stmt-based
2 # binlogging is not supported.
4 # This should always be logged as a statement, even when executed as a
5 # row-by-row deletion.
7 # $before_truncate    A statement to execute (just) before issuing the
8 #                     TRUNCATE TABLE
11 eval CREATE TABLE t1 (a INT) ENGINE=$engine;
12 eval CREATE TABLE t2 (a INT) ENGINE=$engine;
13 INSERT INTO t2 VALUES (1),(2),(3);
14 let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
15 if (`select length('$before_truncate') > 0`) {
16   eval $before_truncate;
18 --echo **** Truncate of empty table shall be logged
19 TRUNCATE TABLE t1;
21 if (`select length('$before_truncate') > 0`) {
22   eval $before_truncate;
24 TRUNCATE TABLE t2;
25 source include/show_binlog_events.inc;
27 DROP TABLE t1,t2;