1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-24 14:48:09 +03:00
Files
mariadb/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
Davi Arnaut 3c279d9a5a Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
The problem was that TRUNCATE TABLE didn't take a exclusive
lock on a table if it resorted to truncating via delete of
all rows in the table. Specifically for InnoDB tables, this
could break proper isolation as InnoDB ends up aborting some
granted locks when truncating a table.

The solution is to take a exclusive metadata lock before
TRUNCATE TABLE can proceed. This guarantees that no other
transaction is using the table.

Incompatible change: Truncate via delete no longer fails
if sql_safe_updates is activated (this was a undocumented
side effect).
2010-05-25 17:01:38 -03:00

18 lines
316 B
Plaintext

source include/have_log_bin.inc;
SET @old_binlog_format=@@binlog_format;
let $engine = MyISAM;
SET BINLOG_FORMAT=ROW;
RESET MASTER;
source extra/binlog_tests/binlog_truncate.test;
SET BINLOG_FORMAT=STATEMENT;
RESET MASTER;
source extra/binlog_tests/binlog_truncate.test;
SET BINLOG_FORMAT=@old_binlog_format;