| 1 |
# |
| 2 |
# Ensure that calling SHOW BINLOG EVENTS FROM <offset> with an invalid offset |
| 3 |
# will not result in error messages in the server log. That is, this call is a |
| 4 |
# read operation for a user, and if it fails due to invalid usage, that is not |
| 5 |
# a server error, but only one to report to the user. |
| 6 |
# |
| 7 |
# References: |
| 8 |
# MDEV-32628: Cryptic ERROR message & inconsistent behavior on incorrect |
| 9 |
# SHOW BINLOG EVENTS FROM ... |
| 10 |
# |
| 11 |
--source include/have_binlog_format_row.inc |
| 12 |
|
| 13 |
--echo # |
| 14 |
--echo # Initialize test data |
| 15 |
set @save_master_verify_checksum = @@global.master_verify_checksum; |
| 16 |
set @@global.master_verify_checksum = 1; |
| 17 |
create table t1 (a int); |
| 18 |
insert into t1 values (1); |
| 19 |
--let $middle_binlog_pos= query_get_value(SHOW BINARY LOGS, File_size, 1) |
| 20 |
insert into t1 values (2); |
| 21 |
|
| 22 |
--let $assert_text= Ensure the client error is not in the server log |
| 23 |
--let $assert_select= Error in Log_event |
| 24 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 25 |
--let $assert_count= 0 |
| 26 |
--let $assert_only_after = CURRENT_TEST: |
| 27 |
|
| 28 |
|
| 29 |
# Pre MDEV-32628, this would write an event truncated error in the logs |
| 30 |
--let $invalid_pos= `SELECT $middle_binlog_pos - 1` |
| 31 |
--replace_result $invalid_pos invalid_pos |
| 32 |
--error 1220 |
| 33 |
--eval SHOW BINLOG EVENTS FROM $invalid_pos |
| 34 |
--source include/assert_grep.inc |
| 35 |
|
| 36 |
# Pre MDEV-32628, this would write an event too big error in the logs |
| 37 |
--error 1220 |
| 38 |
SHOW BINLOG EVENTS FROM 500; |
| 39 |
--source include/assert_grep.inc |
| 40 |
|
| 41 |
|
| 42 |
# Pre MDEV-32628, this would write a checksum verification failed error in the logs |
| 43 |
--error 1220 |
| 44 |
SHOW BINLOG EVENTS FROM 498; |
| 45 |
--source include/assert_grep.inc |
| 46 |
--let $assert_text= Ensure there is not a specific checksum failure error |
| 47 |
--let $assert_select= Replication event checksum verification failed while reading from a log file |
| 48 |
--source include/assert_grep.inc |
| 49 |
|
| 50 |
--echo # |
| 51 |
--echo # Cleanup |
| 52 |
set @@global.master_verify_checksum = @save_master_verify_checksum; |
| 53 |
drop table t1; |