| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# - Verify that the pre-WL#344 format of relay_log.info can still be |
| 4 |
# parsed. |
| 5 |
|
| 6 |
--source include/master-slave.inc |
| 7 |
|
| 8 |
CREATE TABLE t1 (a INT); |
| 9 |
INSERT INTO t1 VALUES (1); |
| 10 |
DROP TABLE t1; |
| 11 |
--sync_slave_with_master |
| 12 |
|
| 13 |
--echo ==== Check that we still understand the old format of relay-log.info ==== |
| 14 |
--source include/stop_slave.inc |
| 15 |
|
| 16 |
--let $master_use_gtid_option= No |
| 17 |
--source include/reset_slave.inc |
| 18 |
--let $MYSQLD_DATADIR= `select @@datadir` |
| 19 |
|
| 20 |
# the old version of relay_log.info comes in two versions: with path |
| 21 |
# separator '/' (most systems) and with path separator '\' (windows) |
| 22 |
if ($SYSTEM_PATH_SEPARATOR != /) { |
| 23 |
--let $file_suffix= -win |
| 24 |
} |
| 25 |
# MDEV-19801 changed the default Using_Gtid to Slave_Pos which doesn't |
| 26 |
# automatically purge relay-log.info |
| 27 |
--remove_file $MYSQLD_DATADIR/relay-log.info |
| 28 |
--copy_file $MYSQL_TEST_DIR/std_data/old-format-relay-log$file_suffix.info $MYSQLD_DATADIR/relay-log.info |
| 29 |
|
| 30 |
--echo # Read relay-log.info |
| 31 |
START SLAVE IO_THREAD; |
| 32 |
--source include/wait_for_slave_io_to_start.inc |
| 33 |
--echo # Check that relay log coordinates are equal to those we saved in old-format_relay-log.info |
| 34 |
--let $master_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1) |
| 35 |
--let $master_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) |
| 36 |
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) |
| 37 |
--let $relay_log_pos= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1) |
| 38 |
--echo $master_file= $master_file, $master_pos, $relay_log_file, $relay_log_pos |
| 39 |
if (`SELECT "$master_file" != "" OR |
| 40 |
"$master_pos" != "0" OR |
| 41 |
"$relay_log_file" != "slave-relay-bin.000001" OR |
| 42 |
"$relay_log_pos" != "4"`) { |
| 43 |
--echo ERROR: log coordinates changed |
| 44 |
--die log coordinates changed |
| 45 |
} |
| 46 |
|
| 47 |
--echo # |
| 48 |
--echo # MDEV-38020: Master & relay log info files read 2^31 and above incorrectly |
| 49 |
--echo # |
| 50 |
|
| 51 |
--connection server_2 |
| 52 |
--source include/stop_slave.inc |
| 53 |
|
| 54 |
# Create a relay-log.info file with a position value > 2^31 |
| 55 |
--let $MYSQLD_DATADIR= `select @@datadir` |
| 56 |
--remove_file $MYSQLD_DATADIR/relay-log.info |
| 57 |
--write_file $MYSQLD_DATADIR/relay-log.info |
| 58 |
./slave-relay-bin.000001 |
| 59 |
2147483648 |
| 60 |
|
| 61 |
0 |
| 62 |
EOF |
| 63 |
|
| 64 |
--let $rpl_server_number= 2 |
| 65 |
--let $rpl_server_parameters= --skip-slave-start |
| 66 |
--source include/rpl_restart_server.inc |
| 67 |
|
| 68 |
--let $assert_text= relay_log_pos should be 2147483648 after restart |
| 69 |
--let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] = 2147483648 |
| 70 |
--source include/assert.inc |
| 71 |
|
| 72 |
--let $rpl_only_running_threads= 1 |
| 73 |
--source include/rpl_end.inc |