mirror of
https://github.com/MariaDB/server.git
synced 2025-08-24 14:48:09 +03:00
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).
18 lines
316 B
Plaintext
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;
|