Debian Codegraph @

mysql-test/suite/group_replication/t/gr_sql_api_max_connections.test

raw
1 --echo #
2 --echo # WL#13378: Component service to add a "admin" session
3 --echo #
4
5 # Validate that SQL API connections, when opened through
6 # mysql_admin_session->open() are not limited by
7 # max_connections option.
8 #
9 # Test:
10 # 0. The test requires one server: M1.
11 # 1. Set max_connections to the value of current connections.
12 # 2. Start Group Replication, the connections established
13 # through SQL API must not be disallowed due to
14 # max_connections being reached.
15 # Start Group Replication must succeed.
16 # 3. Clean up.
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20
21
22 --echo # 1. Set max_connections to the value of current connections.
23 --let $rpl_connection_name= server1
24 --source include/rpl_connection.inc
25 SET @max_connections_saved = @@GLOBAL.max_connections;
26
27 --source include/count_sessions.inc
28 --replace_result $count_sessions CURRENT_CONNECTIONS
29 --eval SET @@GLOBAL.max_connections= ($count_sessions + 2)
30
31 --let $assert_text= max_connections must be the value of current connections
32 --let $assert_cond= [SELECT @@GLOBAL.max_connections] = ($count_sessions + 2)
33 --source include/assert.inc
34
35
36 --echo # 2. Start Group Replication, the connections established
37 --echo # through SQL API must not be disallowed due to
38 --echo # max_connections being reached.
39 --echo # Start Group Replication must succeed.
40 --source include/start_and_bootstrap_group_replication.inc
41
42
43 --echo # 3. Clean up.
44 SET @@GLOBAL.max_connections = @max_connections_saved;
45
46 --source include/group_replication_end.inc
47
48
49 --echo # End of 8.0 tests