mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
7c7de142a3
main.mysqlbinlog_row_innodb are skipped by mtr === Problem === The following tests are wrongly placed in main suite and as a result these are not run with proper binlog format combinations. Some are always skipped by mtr. 1) mysqlbinlog_row_myisam 2) mysqlbinlog_row_innodb 3) mysqlbinlog_row.test 4) mysqlbinlog_row_trans.test 5) mysqlbinlog-cp932 6) mysqlbinlog2 7) mysqlbinlog_base64 === Background === mtr runs the tests placed in main suite with binlog format=stmt. Those that need to be tested against binlog format=row or mixed or more than one binlog format and require only one mysql server are placed in binlog suite. mtr runs tests in binlog suite with all three binlog formats(stmt,row and mixed). === Fix === 1) Moved the test listed in problem section above to binlog suite. 2) Added prefix "binlog_" to the name of each test case moved. Renamed the coresponding result files and option files accordingly. mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc: include file for mysqlbinlog_row_myisam.test and mysqlbinlog_row_myisam.test which are being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog-cp932.result: result file for mysqlbinlog-cp932.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result: result file for mysqlbinlog2.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog_base64.result: result file for mysqlbinlog_base64.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result: result file for mysqlbinlog_row.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result: result file for mysqlbinlog_row_innodb.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result: result file for mysqlbinlog_row_myisam.test which is being moved to binlog suite. mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result: result file for mysqlbinlog_row_trans.test which is being moved to binlog suite. mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932-master.opt: option file for mysqlbinlog-cp932.test which is being moved to binlog suite. mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test: the test requires binlog format=stmt or mixed. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was never run with binlog format=mixed. mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test: the test requires binlog format=stmt or mixed. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was never run with binlog format=mixed. mysql-test/suite/binlog/t/binlog_mysqlbinlog_base64.test: the test requires binlog format=row. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was always skipped by mtr. mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test: the test requires binlog format=row. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was always skipped by mtr. mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test: the test requires binlog format=row. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was always skipped by mtr. mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test: the test requires binlog format=row. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was always skipped by mtr. mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test: the test requires binlog format=row. Since, it was placed in main suite earlier, it was only run with binlog format=stmt, and hence this test was always skipped by mtr.
161 lines
3.7 KiB
Text
161 lines
3.7 KiB
Text
# mysqlbinlog_trans.test
|
|
#
|
|
# Show that mysqlbinlog work correctly with transactions.
|
|
#
|
|
|
|
#--source include/have_myisam.inc
|
|
--let $engine_type_nontrans= MyISAM
|
|
--source include/have_innodb.inc
|
|
--let $engine_type= InnoDB
|
|
|
|
#
|
|
# The test case would also work with statement based or mixed mode logging.
|
|
# But this would require different result files. To handle this with the
|
|
# current test suite, new main test cases are required.
|
|
#
|
|
--source include/have_binlog_format_row.inc
|
|
|
|
--source include/have_log_bin.inc
|
|
|
|
--echo #
|
|
--echo # Preparatory cleanup.
|
|
--echo #
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
--enable_warnings
|
|
|
|
--echo #
|
|
--echo # We need a fixed timestamp to avoid varying results.
|
|
--echo #
|
|
SET timestamp=1000000000;
|
|
|
|
--echo #
|
|
--echo # Delete all existing binary logs.
|
|
--echo #
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Create test tables.
|
|
--echo #
|
|
eval CREATE TABLE t1 (
|
|
c1 INT,
|
|
c2 VARCHAR(20)
|
|
) ENGINE=$engine_type DEFAULT CHARSET latin1;
|
|
eval CREATE TABLE t2 (
|
|
c1 INT,
|
|
c2 VARCHAR(20)
|
|
) ENGINE=$engine_type_nontrans DEFAULT CHARSET latin1;
|
|
|
|
--echo #
|
|
--echo # Start transaction #1, transactional table only, commit.
|
|
--echo #
|
|
START TRANSACTION;
|
|
|
|
--echo #
|
|
--echo # Do some statements.
|
|
--echo #
|
|
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t1 SET c1 = c1 + 10;
|
|
DELETE FROM t1 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Commit transaction.
|
|
--echo #
|
|
COMMIT;
|
|
SELECT * FROM t1;
|
|
TRUNCATE TABLE t1;
|
|
|
|
--echo #
|
|
--echo # Start transaction #2, transactional table only, rollback.
|
|
--echo #
|
|
START TRANSACTION;
|
|
|
|
--echo #
|
|
--echo # Do some statements.
|
|
--echo #
|
|
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t1 SET c1 = c1 + 10;
|
|
DELETE FROM t1 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Rollback transaction.
|
|
--echo #
|
|
ROLLBACK;
|
|
SELECT * FROM t1;
|
|
TRUNCATE TABLE t1;
|
|
|
|
--echo #
|
|
--echo # Start transaction #3, both tables, commit.
|
|
--echo #
|
|
START TRANSACTION;
|
|
|
|
--echo #
|
|
--echo # Do some statements on the transactional table.
|
|
--echo #
|
|
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t1 SET c1 = c1 + 10;
|
|
DELETE FROM t1 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Do some statements on the non-transactional table.
|
|
--echo #
|
|
INSERT INTO t2 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t2 SET c1 = c1 + 10;
|
|
DELETE FROM t2 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Commit transaction.
|
|
--echo #
|
|
COMMIT;
|
|
SELECT * FROM t1;
|
|
SELECT * FROM t2;
|
|
TRUNCATE TABLE t1;
|
|
TRUNCATE TABLE t2;
|
|
|
|
--echo #
|
|
--echo # Start transaction #4, both tables, rollback.
|
|
--echo #
|
|
START TRANSACTION;
|
|
|
|
--echo #
|
|
--echo # Do some statements on the transactional table.
|
|
--echo #
|
|
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t1 SET c1 = c1 + 10;
|
|
DELETE FROM t1 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Do some statements on the non-transactional table.
|
|
--echo #
|
|
INSERT INTO t2 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
|
UPDATE t2 SET c1 = c1 + 10;
|
|
DELETE FROM t2 WHERE c1 = 12;
|
|
|
|
--echo #
|
|
--echo # Rollback transaction.
|
|
--echo #
|
|
ROLLBACK;
|
|
SELECT * FROM t1;
|
|
SELECT * FROM t2;
|
|
TRUNCATE TABLE t1;
|
|
TRUNCATE TABLE t2;
|
|
|
|
--echo #
|
|
--echo # Flush all log buffers to the log file.
|
|
--echo #
|
|
FLUSH LOGS;
|
|
|
|
--echo #
|
|
--echo # Call mysqlbinlog to display the log file contents.
|
|
--echo #
|
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/
|
|
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
|
|
|
--echo #
|
|
--echo # Cleanup.
|
|
--echo #
|
|
DROP TABLE t1, t2;
|
|
|
|
|