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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
################################################################################
# Bug#18338203 P_S REPLICATION_CONNECTION_STATUS.SOURCE_UUID UNINITIALIZED VALUE
#
# The master_uuid field was introduced in mysql-5.6.0.
# When replicating from a pre-5.6.0 master to a 5.7 slave,
# the slave will ask for the master_uuid field which the master doesnt have.
# Prior to fix, the P_S code made an assuption that if there is a master
# there will be a master_uuid for the master which is not true in the case
# of say 5.5->5.7 replication. Since the P_S code blindly copied MASTER_UUID
# bytes from mi object, we ended up with a garbage value in the select
# SOURCE_UUID field from P_S.replication_connect_status
################################################################################
--source include/not_group_replication_plugin.inc
--source include/have_debug_sync.inc
# Testing it in one mode is enough
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--source include/rpl_connection_slave.inc
--source include/stop_slave.inc
--let $orig_master_uuid= query_get_value(select source_uuid from performance_schema.replication_connection_status, source_uuid, 1)
--echo #
--echo # Explicitly simulate a NULL master_uuid return value i.e., fake as a pre-5.6 master.
--echo #
SET @save_debug= @@GLOBAL.debug;
SET GLOBAL debug= '+d,dbug.return_null_SOURCE_UUID';
--echo #
--echo # We should still have the master_uuid value.
--echo #
--let $instrumented_master_uuid= query_get_value(select source_uuid from performance_schema.replication_connection_status, source_uuid, 1)
--let $assert_text= source_uuid field should be non-empty.
--let $assert_cond= "$instrumented_master_uuid" != ""
--source include/assert.inc
--let $instrumented_master_uuid=
--echo #
--echo # START SLAVE will return a NULL for master_uuid now as per our debug behaviour.
--echo #
--source include/start_slave.inc
--echo #
--echo # We dont have a master_uuid now, so should see an empty output as the master_uuid value.
--echo #
--let $wait_condition=select source_uuid = "" from performance_schema.replication_connection_status
--source include/wait_condition.inc
--echo #
--echo # de-activate the debug behaviour.
--echo #
SET GLOBAL debug= '-d,dbug.return_null_SOURCE_UUID';
SET GLOBAL debug= @save_debug;
--echo #
--echo # After de-activating, the master_uuid value should be there.
--echo #
--source include/stop_slave.inc
--source include/start_slave.inc
--echo #
--echo # Verify that we have the master_uuid now.
--echo #
--let $wait_condition=select source_uuid = "$orig_master_uuid" from performance_schema.replication_connection_status
--source include/wait_condition.inc
--let $wait_condition=
--let $orig_master_uuid=
--source include/rpl_end.inc
|