| 1 |
# Test for copying log tables tail |
| 2 |
--source include/have_aria.inc |
| 3 |
--source include/have_debug.inc |
| 4 |
|
| 5 |
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup |
| 6 |
|
| 7 |
CREATE TABLE t(i INT) |
| 8 |
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1; |
| 9 |
|
| 10 |
# Truncate the log in order to make the test ./mtr --repeat proof |
| 11 |
SET GLOBAL general_log = 0; |
| 12 |
TRUNCATE mysql.general_log; |
| 13 |
SET GLOBAL general_log = 1; |
| 14 |
SET GLOBAL log_output = 'TABLE'; |
| 15 |
|
| 16 |
INSERT INTO t VALUES (1); |
| 17 |
|
| 18 |
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query |
| 19 |
--sorted_result |
| 20 |
SELECT * FROM mysql.general_log |
| 21 |
WHERE argument LIKE "INSERT INTO %" AND |
| 22 |
(command_type = "Query" OR command_type = "Execute") ; |
| 23 |
|
| 24 |
--echo # Insert new row into general_log table after it has been copied on BLOCK_DDL. |
| 25 |
--let after_stage_block_ddl=INSERT INTO test.t VALUES (2) |
| 26 |
|
| 27 |
--echo # Backup to dir. |
| 28 |
--disable_result_log |
| 29 |
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events |
| 30 |
--enable_result_log |
| 31 |
|
| 32 |
--echo # Xtrabackup prepare. |
| 33 |
--disable_result_log |
| 34 |
--exec $XTRABACKUP --prepare --target-dir=$targetdir |
| 35 |
--source include/restart_and_restore.inc |
| 36 |
--enable_result_log |
| 37 |
|
| 38 |
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query |
| 39 |
--sorted_result |
| 40 |
SELECT * FROM mysql.general_log |
| 41 |
WHERE argument LIKE "INSERT INTO %" AND |
| 42 |
(command_type = "Query" OR command_type = "Execute") ; |
| 43 |
|
| 44 |
--rmdir $targetdir |
| 45 |
DROP TABLE t; |