| 1 |
--source include/have_debug.inc |
| 2 |
--source include/have_binlog_format_row.inc |
| 3 |
|
| 4 |
--let $MYSQLD_DATADIR= `select @@datadir` |
| 5 |
|
| 6 |
CREATE TABLE t (a TEXT); |
| 7 |
# events of interest are guaranteed to stay in 000001 log |
| 8 |
RESET MASTER; |
| 9 |
--eval INSERT INTO t SET a=repeat('a', 1024) |
| 10 |
--disable_cursor_protocol |
| 11 |
SELECT a into @a from t; |
| 12 |
--enable_cursor_protocol |
| 13 |
FLUSH LOGS; |
| 14 |
DELETE FROM t; |
| 15 |
|
| 16 |
--exec $MYSQL_BINLOG --verbose --debug-binlog-row-event-max-encoded-size=256 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql |
| 17 |
|
| 18 |
--let SEARCH_PATTERN= BINLOG @binlog_fragment_0, @binlog_fragment_1 |
| 19 |
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql |
| 20 |
--source include/search_pattern_in_file.inc |
| 21 |
|
| 22 |
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql |
| 23 |
|
| 24 |
SELECT a LIKE @a as 'true' FROM t; |
| 25 |
|
| 26 |
# improper syntax error |
| 27 |
--echo BINLOG number-of-fragments must be exactly two |
| 28 |
--error ER_PARSE_ERROR |
| 29 |
BINLOG @binlog_fragment; |
| 30 |
--error ER_PARSE_ERROR |
| 31 |
BINLOG @binlog_fragment, @binlog_fragment, @binlog_fragment; |
| 32 |
|
| 33 |
# corrupted fragments error check (to the expected error code notice, |
| 34 |
# the same error code occurs in a similar unfragmented case) |
| 35 |
SET @binlog_fragment_0='012345'; |
| 36 |
SET @binlog_fragment_1='012345'; |
| 37 |
--error ER_SYNTAX_ERROR |
| 38 |
BINLOG @binlog_fragment_0, @binlog_fragment_1; |
| 39 |
|
| 40 |
# Not existing fragment is not allowed |
| 41 |
SET @binlog_fragment_0='012345'; |
| 42 |
--error ER_WRONG_TYPE_FOR_VAR |
| 43 |
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist; |
| 44 |
|
| 45 |
# MDEV-22520 |
| 46 |
SET @a= '42'; |
| 47 |
--error ER_SYNTAX_ERROR |
| 48 |
BINLOG @a, @a; |
| 49 |
|
| 50 |
--echo # Cleanup |
| 51 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql |
| 52 |
DROP TABLE t; |