mirror of
https://github.com/MariaDB/server.git
synced 2025-11-28 17:36:30 +03:00
Sometimes, the test would fail with a result difference for the READ UNCOMMITTED read, because the incremental backup would finish before redo log was written for all the rows that were inserted in the second batch. To fix that, cause a redo log write by creating another transaction. The transaction rollback (which internally does commit) will be flushed to the redo log, and before that, all the preceding changes will be flushed to the redo log as well.
34 lines
703 B
Plaintext
34 lines
703 B
Plaintext
call mtr.add_suppression("InnoDB: New log files created");
|
|
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
|
|
INSERT INTO t VALUES(0);
|
|
COMMIT;
|
|
start transaction;
|
|
BEGIN;
|
|
DELETE FROM t LIMIT 1;
|
|
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
|
|
ROLLBACK;
|
|
NOT FOUND /Rollback of trx with id/ in current_test
|
|
# expect NOT FOUND
|
|
NOT FOUND /Rollback of trx with id/ in current_test
|
|
# expect NOT FOUND
|
|
commit;
|
|
SELECT count(*) FROM t;
|
|
count(*)
|
|
201
|
|
# Restore and check results
|
|
# shutdown server
|
|
# remove datadir
|
|
# xtrabackup move back
|
|
# restart server
|
|
SELECT COUNT(*) FROM t;
|
|
COUNT(*)
|
|
1
|
|
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
SELECT COUNT(*) FROM t;
|
|
COUNT(*)
|
|
201
|
|
SELECT * FROM t;
|
|
a
|
|
0
|
|
DROP TABLE t;
|