File: log_tables.test

package info (click to toggle)
mariadb 1%3A10.11.11-0%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 597,064 kB
  • sloc: ansic: 2,386,076; cpp: 1,663,071; asm: 378,311; perl: 62,203; pascal: 38,769; sh: 37,071; java: 33,919; sql: 19,830; yacc: 19,727; xml: 10,509; python: 9,522; ruby: 8,544; cs: 5,855; makefile: 5,793; ada: 1,700; lex: 1,207; javascript: 1,039; objc: 80; tcl: 73; awk: 46; php: 22
file content (45 lines) | stat: -rw-r--r-- 1,407 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Test for copying log tables tail
--source include/have_aria.inc
--source include/have_debug.inc

--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup

CREATE TABLE t(i INT)
  ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;

# Truncate the log in order to make the test ./mtr --repeat proof
SET GLOBAL general_log = 0;
TRUNCATE mysql.general_log;
SET GLOBAL general_log = 1;
SET GLOBAL log_output = 'TABLE';

INSERT INTO t VALUES (1);

--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
--sorted_result
SELECT * FROM mysql.general_log
  WHERE argument LIKE "INSERT INTO %" AND
  (command_type = "Query" OR command_type = "Execute") ;

--echo # Insert new row into general_log table after it has been copied on BLOCK_DDL.
--let after_stage_block_ddl=INSERT INTO test.t VALUES (2)

--echo # Backup to dir.
--disable_result_log
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events
--enable_result_log

--echo # Xtrabackup prepare.
--disable_result_log
--exec $XTRABACKUP  --prepare --target-dir=$targetdir
--source include/restart_and_restore.inc
--enable_result_log

--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
--sorted_result
SELECT * FROM mysql.general_log
  WHERE argument LIKE "INSERT INTO %" AND
  (command_type = "Query" OR command_type = "Execute") ;

--rmdir $targetdir
DROP TABLE t;