File: rpl_perfschema_no_master_uuid.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (79 lines) | stat: -rw-r--r-- 2,777 bytes parent folder | download
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