Debian Codegraph @

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

raw
1 ################################################################################
2 # This test does basic check around UNINSTALL and INSTALL PLUGIN commands.
3 #
4 # Test:
5 # 0. The test requires one server.
6 # 1. Bootstrap start GR.
7 # - Verify that GR specific two P_S tables are not empty.
8 # 2. Uninstall plugin.
9 # - Then uninstall it again twice; expect ER_SP_DOES_NOT_EXIST.
10 # - Verify that GR specific two P_S tables are empty.
11 # 3. Install plugin.
12 # - Then try installing it again twice; expect ER_UDF_EXISTS.
13 # - Verify that GR specific two P_S tables are are not empty.
14 ################################################################################
15 --source include/force_restart.inc
16 --source include/have_group_replication_plugin_base.inc
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20
21 --echo
22 --echo # 1. Bootstrap start GR.
23 --echo # Verify that group replication specific P_S tables are not empty.
24 --let $rpl_connection_name= server1
25 --source include/rpl_connection.inc
26 --source include/start_and_bootstrap_group_replication.inc
27
28 --let $assert_text= P_S table replication_group_members should not be empty
29 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_members]" = 1
30 --source include/assert.inc
31
32 --let $assert_text= P_S table replication_group_member_stats should not be empty
33 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_member_stats]" = 1
34 --source include/assert.inc
35
36 --echo
37 --echo # 2. Uninstall plugin.
38 --echo # Then uninstall it again twice; expect ER_SP_DOES_NOT_EXIST.
39 --echo # Verify that group replication specific P_S tables are empty.
40 --source include/uninstall_group_replication_plugin.inc
41
42 --error ER_SP_DOES_NOT_EXIST
43 UNINSTALL PLUGIN group_replication;
44
45 --let $assert_text= P_S table replication_group_members should be empty
46 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_members]" = 0
47 --source include/assert.inc
48
49 --let $assert_text= P_S table replication_group_member_stats should be empty
50 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_member_stats]" = 0
51 --source include/assert.inc
52
53 --echo
54 --echo # 3. Install plugin.
55 --echo # Then Install it again twice; expect ER_UDF_EXISTS.
56 --echo # Verify that GR specific two P_S tables are are not empty.
57 --source include/install_group_replication_plugin.inc
58
59 --replace_result $GROUP_REPLICATION GROUP_REPLICATION
60 --error ER_UDF_EXISTS
61 --eval INSTALL PLUGIN group_replication SONAME '$GROUP_REPLICATION'
62
63 --let $assert_text= P_S table replication_group_members should not be empty
64 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_members]" = 1
65 --source include/assert.inc
66
67 --let $assert_text= P_S table replication_group_member_stats should not be empty
68 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_member_stats]" = 1
69 --source include/assert.inc
70
71 --source include/group_replication_end.inc