File: binlog_mysqlbinlog_row_frag.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (52 lines) | stat: -rw-r--r-- 1,572 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
46
47
48
49
50
51
52
--source include/have_debug.inc
--source include/have_binlog_format_row.inc

--let $MYSQLD_DATADIR= `select @@datadir`

CREATE TABLE t (a TEXT);
# events of interest are guaranteed to stay in 000001 log
RESET MASTER;
--eval INSERT INTO t SET a=repeat('a', 1024)
--disable_cursor_protocol
SELECT a into @a from t;
--enable_cursor_protocol
FLUSH LOGS;
DELETE FROM t;

--exec $MYSQL_BINLOG --verbose --debug-binlog-row-event-max-encoded-size=256 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql

--let SEARCH_PATTERN= BINLOG @binlog_fragment_0, @binlog_fragment_1
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
--source include/search_pattern_in_file.inc

--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql

SELECT a LIKE @a as 'true' FROM t;

# improper syntax error
--echo BINLOG number-of-fragments must be exactly two
--error ER_PARSE_ERROR
BINLOG @binlog_fragment;
--error ER_PARSE_ERROR
BINLOG @binlog_fragment, @binlog_fragment, @binlog_fragment;

# corrupted fragments error check (to the expected error code notice,
# the same error code occurs in a similar unfragmented case)
SET @binlog_fragment_0='012345';
SET @binlog_fragment_1='012345';
--error ER_SYNTAX_ERROR
BINLOG @binlog_fragment_0, @binlog_fragment_1;

# Not existing fragment is not allowed
SET @binlog_fragment_0='012345';
--error ER_WRONG_TYPE_FOR_VAR
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;

# MDEV-22520
SET @a= '42';
--error ER_SYNTAX_ERROR
BINLOG @a, @a;

--echo # Cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
DROP TABLE t;