File: gr_group_name_validation_on_boot.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 (60 lines) | stat: -rw-r--r-- 3,372 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
################################################################################
# BUG#21141822 - GR(USABILITY): GROUP_REPLICATION_GROUP_NAME VAR IS NOT
#                VALIDATED ON GROUP START
# BUG#21456559 - GR-GROUP-NAME SETS TO INCORRECT VALUE IF PASSED WITH
#                'GR-START-ON-BOOT'=ON
#
# This test verifies that group_name validation is done correctly when
# starting on boot as well as when we pass it manually in the test.
# Before this patch, the group_name with a length longer than the length of
# the valid UUID was being accepted which was causing problem going forward
# like assigning an invalid GTID to the GTID_EXECUTED value.
#
# Test:
# 0. The test requires one server: M1.
# 1. Starting the server with invalid group_name being passed on boot.
# 2. Asserting that the error due to invalid group name is being thrown.
# 3. Starting the server with boot option OFF.
# 4. Passing an incorrect value to group_name throws an error.
################################################################################

--source include/have_group_replication_plugin.inc
--let $group_replication_group_name_invalid=aaaaaaaa-aaaa-aaaa-aaaa-invalidvalueused
--eval SET GLOBAL group_replication_group_name= "aeaeaeae-aeae-aeae-aeae-aeaeaeaeaeae"

SET SESSION sql_log_bin=0;
call mtr.add_suppression("is not a valid UUID");
call mtr.add_suppression("'group_replication' init function returned error");
SET SESSION sql_log_bin=1;

--echo
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--echo [ON SERVER1]
--source include/start_and_bootstrap_group_replication.inc

# Phase 1: Starting the server with invalid group_name being passed on boot
--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group-replication-start-on-boot=1 --group-replication-group-name=$group_replication_group_name_invalid --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc

--echo # Asserting that the error due to invalid group name is being thrown.
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_group_name_error_on_boot.err
--let $grep_pattern=is not a valid UUID
--let $grep_output= print_count
--source include/grep_pattern.inc

# Starting the server with boot option OFF
--let $allow_rpl_inited=1
--let $restart_parameters=restart:--group-replication-start-on-boot=0 --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc

# Phase 2:  Passing an incorrect value to group_name throws an error
--error ER_WRONG_VALUE_FOR_VAR
--eval SET GLOBAL group_replication_group_name="$group_replication_group_name_invalid"

--source include/gr_clear_configuration.inc