mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Automerge BUG 51251 bundle from bug report --> mysql-5.1-bugteam.
This commit is contained in:
28
mysql-test/suite/binlog/r/binlog_row_innodb_truncate.result
Normal file
28
mysql-test/suite/binlog/r/binlog_row_innodb_truncate.result
Normal file
@ -0,0 +1,28 @@
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
###############################################
|
||||
RESET MASTER;
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
###############################################
|
@ -413,7 +413,6 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
|
37
mysql-test/suite/binlog/t/binlog_row_innodb_truncate.test
Normal file
37
mysql-test/suite/binlog/t/binlog_row_innodb_truncate.test
Normal file
@ -0,0 +1,37 @@
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# BUG#51251
|
||||
#
|
||||
# The test case checks if truncating a temporary table created with
|
||||
# engine InnoDB will not cause the truncate statement to be binlogged.
|
||||
|
||||
# Before patch for BUG#51251, the TRUNCATE statements below would be
|
||||
# binlogged, which would cause the slave to fail with "table does not
|
||||
# exist".
|
||||
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
Reference in New Issue
Block a user