| 1 |
################################################################################ |
| 2 |
# Bug#18338203 P_S REPLICATION_CONNECTION_STATUS.SOURCE_UUID UNINITIALIZED VALUE |
| 3 |
# |
| 4 |
# The master_uuid field was introduced in mysql-5.6.0. |
| 5 |
# When replicating from a pre-5.6.0 master to a 5.7 slave, |
| 6 |
# the slave will ask for the master_uuid field which the master doesnt have. |
| 7 |
# Prior to fix, the P_S code made an assuption that if there is a master |
| 8 |
# there will be a master_uuid for the master which is not true in the case |
| 9 |
# of say 5.5->5.7 replication. Since the P_S code blindly copied MASTER_UUID |
| 10 |
# bytes from mi object, we ended up with a garbage value in the select |
| 11 |
# SOURCE_UUID field from P_S.replication_connect_status |
| 12 |
################################################################################ |
| 13 |
--source include/not_group_replication_plugin.inc |
| 14 |
--source include/have_debug_sync.inc |
| 15 |
# Testing it in one mode is enough |
| 16 |
--source include/have_binlog_format_row.inc |
| 17 |
--source include/master-slave.inc |
| 18 |
|
| 19 |
--source include/rpl_connection_slave.inc |
| 20 |
--source include/stop_slave.inc |
| 21 |
|
| 22 |
--let $orig_master_uuid= query_get_value(select source_uuid from performance_schema.replication_connection_status, source_uuid, 1) |
| 23 |
|
| 24 |
--echo # |
| 25 |
--echo # Explicitly simulate a NULL master_uuid return value i.e., fake as a pre-5.6 master. |
| 26 |
--echo # |
| 27 |
|
| 28 |
SET @save_debug= @@GLOBAL.debug; |
| 29 |
SET GLOBAL debug= '+d,dbug.return_null_SOURCE_UUID'; |
| 30 |
|
| 31 |
--echo # |
| 32 |
--echo # We should still have the master_uuid value. |
| 33 |
--echo # |
| 34 |
|
| 35 |
--let $instrumented_master_uuid= query_get_value(select source_uuid from performance_schema.replication_connection_status, source_uuid, 1) |
| 36 |
|
| 37 |
--let $assert_text= source_uuid field should be non-empty. |
| 38 |
--let $assert_cond= "$instrumented_master_uuid" != "" |
| 39 |
--source include/assert.inc |
| 40 |
|
| 41 |
--let $instrumented_master_uuid= |
| 42 |
|
| 43 |
--echo # |
| 44 |
--echo # START SLAVE will return a NULL for master_uuid now as per our debug behaviour. |
| 45 |
--echo # |
| 46 |
|
| 47 |
--source include/start_slave.inc |
| 48 |
|
| 49 |
--echo # |
| 50 |
--echo # We dont have a master_uuid now, so should see an empty output as the master_uuid value. |
| 51 |
--echo # |
| 52 |
|
| 53 |
--let $wait_condition=select source_uuid = "" from performance_schema.replication_connection_status |
| 54 |
--source include/wait_condition.inc |
| 55 |
|
| 56 |
--echo # |
| 57 |
--echo # de-activate the debug behaviour. |
| 58 |
--echo # |
| 59 |
|
| 60 |
SET GLOBAL debug= '-d,dbug.return_null_SOURCE_UUID'; |
| 61 |
SET GLOBAL debug= @save_debug; |
| 62 |
|
| 63 |
--echo # |
| 64 |
--echo # After de-activating, the master_uuid value should be there. |
| 65 |
--echo # |
| 66 |
|
| 67 |
--source include/stop_slave.inc |
| 68 |
--source include/start_slave.inc |
| 69 |
|
| 70 |
--echo # |
| 71 |
--echo # Verify that we have the master_uuid now. |
| 72 |
--echo # |
| 73 |
|
| 74 |
--let $wait_condition=select source_uuid = "$orig_master_uuid" from performance_schema.replication_connection_status |
| 75 |
--source include/wait_condition.inc |
| 76 |
|
| 77 |
--let $wait_condition= |
| 78 |
--let $orig_master_uuid= |
| 79 |
--source include/rpl_end.inc |