File: binlog_mysqlbinlog_row_frag.test

package info (click to toggle)
mariadb-10.1 10.1.45-0%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 476,916 kB
  • sloc: cpp: 1,124,656; ansic: 871,843; perl: 52,917; sh: 40,078; pascal: 35,370; javascript: 15,555; yacc: 14,728; ruby: 8,684; xml: 5,377; sql: 3,490; makefile: 2,934; python: 1,970; java: 1,691; asm: 837; lex: 757; php: 22; sed: 16
file content (45 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download
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
--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)
SELECT a from t into @a;
FLUSH LOGS;
DELETE FROM t;

--exec $MYSQL_BINLOG --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;

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