Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_03.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6 [connection server2]
7 [connection server1]
8
9 # 1. Execute switch to single primary mode:
10 # 1.1. With extra arguments it must fail.
11 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID", "extra", "arguments");
12 ERROR HY000: Can't initialize function 'group_replication_switch_to_single_primary_mode'; Wrong arguments: This function either takes no arguments or a single server uuid.
13 # 1.2. With invalid uuid it must fail.
14 SELECT group_replication_switch_to_single_primary_mode("not an uuid");
15 ERROR HY000: Can't initialize function 'group_replication_switch_to_single_primary_mode'; Wrong arguments: The server uuid is not valid.
16 # 1.3. With an unknown uuid it must fail.
17 SELECT group_replication_switch_to_single_primary_mode("aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa");
18 ERROR HY000: Can't initialize function 'group_replication_switch_to_single_primary_mode'; The requested uuid is not a member of the group.
19 # 1.4. With NULL it must fail.
20 SELECT group_replication_switch_to_single_primary_mode(NULL);
21 ERROR HY000: Can't initialize function 'group_replication_switch_to_single_primary_mode'; Wrong arguments: This function either takes no arguments or a single server uuid.
22 # 1.5. With empty string it must fail.
23 SELECT group_replication_set_as_primary("");
24 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: You need to specify a server uuid.
25
26 # 2. Change to single primary mode to test action of set as primary and
27 # switch to multi primary
28 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
29 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
30 Mode switched to single-primary successfully.
31
32 # 3. Execute action of set a new primary:
33 # 3.1. With extra arguments it must fail.
34 SELECT group_replication_set_as_primary("MEMBER1_UUID", "extra", "arguments");
35 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: UDF accepts maximum of 2 parameters.
36 # 3.2. With invalid uuid it must fail.
37 SELECT group_replication_set_as_primary("not an uuid");
38 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: The server uuid is not valid.
39 # 3.3. With an unknown uuid it must fail.
40 SELECT group_replication_set_as_primary("aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa");
41 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; The requested uuid is not a member of the group.
42 # 3.4. With NULL it must fail.
43 SELECT group_replication_set_as_primary(NULL);
44 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: You need to specify a server uuid.
45 # 3.5. With empty string it must fail.
46 SELECT group_replication_set_as_primary("");
47 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: You need to specify a server uuid.
48 # 3.6. With blank value it must fail.
49 SELECT group_replication_set_as_primary();
50 ERROR HY000: Can't initialize function 'group_replication_set_as_primary'; Wrong arguments: You need to specify a server uuid.
51
52 # 4. Execute action to switch to multi primary mode:
53 # 4.1. With extra arguments it must fail.
54 SELECT group_replication_switch_to_multi_primary_mode("extra", "arguments");
55 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
56 # 4.2. With invalid uuid it must fail.
57 SELECT group_replication_switch_to_multi_primary_mode("not an uuid");
58 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
59 # 4.3. With an unknown uuid it must fail.
60 SELECT group_replication_switch_to_multi_primary_mode("aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa");
61 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
62 # 4.4. With NULL it must fail.
63 SELECT group_replication_switch_to_multi_primary_mode(NULL);
64 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
65 # 4.5. With empty string it must fail.
66 SELECT group_replication_switch_to_multi_primary_mode("");
67 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
68 # 4.6. With valid and known uuid it must fail.
69 SELECT group_replication_switch_to_multi_primary_mode("$server1_uuid");
70 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
71
72 # 5. Change to multi primary mode to test action with output of a table.
73 SELECT group_replication_switch_to_multi_primary_mode();
74 group_replication_switch_to_multi_primary_mode()
75 Mode switched to multi-primary successfully.
76
77 # 6. Create a table to test the functions with SQL outputs
78 CREATE TABLE test.t1 (a INT PRIMARY KEY NOT NULL AUTO_INCREMENT, b CHAR(36));
79
80 # 7. Test group_replication_switch_to_single_primary_mode output (SQL parameter).
81 # 7.1. With invalid uuid it must fail.
82 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=1;
83 ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Wrong arguments: The server uuid is not valid.
84 # 7.2. With an unknown uuid it must fail.
85 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=2;
86 ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. The requested uuid is not a member of the group.
87 # 7.3. With NULL it must fail.
88 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=3;
89 ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Wrong arguments: You need to specify a server uuid.
90 # 7.4. With empty string it must fail.
91 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=4;
92 ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Wrong arguments: You need to specify a server uuid.
93 # 7.5. Mode switched to single-primary successfully.
94 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=5;
95 group_replication_switch_to_single_primary_mode(b)
96 Mode switched to single-primary successfully.
97 # 7.6. Already in single-primary mode.
98 SELECT group_replication_switch_to_single_primary_mode(b) FROM test.t1 WHERE a=6;
99 group_replication_switch_to_single_primary_mode(b)
100 Already in single-primary mode. Did you mean to use group_replication_set_as_primary?
101
102 # 8.Test group_replication_switch_to_multi_primary_mode output.
103 SELECT group_replication_switch_to_multi_primary_mode(b) FROM test.t1 ORDER BY a LIMIT 1;
104 ERROR HY000: Can't initialize function 'group_replication_switch_to_multi_primary_mode'; Wrong arguments: This function takes no arguments.
105
106 # 9. Test group_replication_set_as_primary output (SQL parameter).
107 # 9.1. With invalid uuid it must fail.
108 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=1;
109 ERROR HY000: The function 'group_replication_set_as_primary' failed. Wrong arguments: The server uuid is not valid.
110 # 9.2. With an unknown uuid it must fail.
111 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=2;
112 ERROR HY000: The function 'group_replication_set_as_primary' failed. The requested uuid is not a member of the group.
113 # 9.3. With NULL it must fail.
114 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=3;
115 ERROR HY000: The function 'group_replication_set_as_primary' failed. Wrong arguments: You need to specify a server uuid.
116 # 9.4. With empty string it must fail.
117 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=4;
118 ERROR HY000: The function 'group_replication_set_as_primary' failed. Wrong arguments: You need to specify a server uuid.
119 # 9.5. Already the primary member
120 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=5;
121 group_replication_set_as_primary(b)
122 The requested member is already the current group primary.
123 # 9.6. Switch to another member
124 SELECT group_replication_set_as_primary(b) FROM test.t1 WHERE a=6;
125 group_replication_set_as_primary(b)
126 Primary server switched to: MEMBER2_UUID
127 [connection server1]
128 include/gr_assert_secondary_member.inc
129 [connection server2]
130 include/gr_assert_primary_member.inc
131
132 # 10. Cleanup
133 DROP TABLE test.t1;
134 include/rpl_sync.inc
135 include/group_replication_end.inc