Debian Codegraph @

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

raw
1 ################################################################################
2 # Bug#30112711 : LET QUERY WHICH ACCESSES P_S TO FAIL, WHEN MEMORY ALLOCATION IS
3 # FAILED.
4 #
5 # This test verifies that the std::bad_alloc exception is handled properly,
6 # when thrown while adding rows to the
7 # performance_schema.replication_group_member_stats table.
8 #
9 # Test:
10 # 1. Get row from performance_schema.replication_group_member_stats
11 # for current member. It will return one row
12 # 2. Simulate bad_alloc exception for
13 # performance_schema.replication_group_member_stats table by
14 # enabling flow_control_simulate_bad_alloc_exception debug sync point.
15 # 3. Get row from performance_schema.replication_group_member_stats.
16 # It will fail with ER_STD_BAD_ALLOC_ERROR error as
17 # flow_control_simulate_bad_alloc_exception debug sync point was
18 # activated.
19 # 4. Disable flow_control_simulate_bad_alloc_exception debug sync point.
20 # 5. Verify that member is still ONLINE
21 # 6. Verify number of members in the group are still same
22 # 7. Clean Up
23 ################################################################################
24
25 --source include/have_group_replication_plugin.inc
26 --source include/have_debug.inc
27 --source include/group_replication.inc
28
29
30 --echo
31 --echo # 1. Get row from performance_schema.replication_group_member_stats
32 --echo # for current member. It will return one row
33 --let $server_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
34 --let $count_num= query_get_value(SELECT COUNT(*) COUNT from performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid), COUNT, 1)
35 --let $assert_text= The value of member_id should not be empty before starting group replication
36 --let $assert_cond= "$count_num" = "1"
37 --source include/assert.inc
38
39
40 --echo
41 --echo # 2. Simulate bad_alloc exception for
42 --echo # performance_schema.replication_group_member_stats table by
43 --echo # enabling flow_control_simulate_bad_alloc_exception debug sync point.
44 SET SESSION DEBUG='+d,flow_control_simulate_bad_alloc_exception';
45
46
47 --echo
48 --echo # 3. Get row from performance_schema.replication_group_member_stats.
49 --echo # It will fail with ER_STD_BAD_ALLOC_ERROR error as
50 --echo # flow_control_simulate_bad_alloc_exception debug sync point was
51 --echo # activated.
52 --error ER_STD_BAD_ALLOC_ERROR
53 SELECT COUNT(*) from performance_schema.replication_group_member_stats;
54
55
56 --echo
57 --echo # 4. Disable flow_control_simulate_bad_alloc_exception debug sync point.
58 SET SESSION DEBUG='-d,flow_control_simulate_bad_alloc_exception';
59
60
61 --echo
62 --echo # 5. Verify that member is still ONLINE
63 --let $group_replication_member_state= ONLINE
64 --source include/gr_wait_for_member_state.inc
65
66
67 --echo
68 --echo # 6. Verify number of members in the group are still same
69 --let $group_replication_number_of_members= $rpl_server_count
70 --source include/gr_wait_for_number_of_members.inc
71
72
73 --echo
74 --echo # 7. Clean Up
75
76 --source include/group_replication_end.inc