| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test script serves as the functionality testing for the table |
| 4 |
# performance_schema.replication_applier_configuration. Test for ddl and dml |
| 5 |
# operations is a part of the perfschema suite. The ddl/dml tests are named: |
| 6 |
# 1) ddl_replication_applier_configuration.test and |
| 7 |
# 2) dml_replication_applier_configuration.test. |
| 8 |
# |
| 9 |
# The follwing scenarios are tested in this script: |
| 10 |
# |
| 11 |
# - Verify that output is same as SSS on a fresh slave. |
| 12 |
# - Verify that the value of this field is correct after STOP SLAVE. |
| 13 |
# - Verify that, when desired delay is set, the value is shown corectly. |
| 14 |
# - Verify that the value is preserved after STOP SLAVE. |
| 15 |
# - Verify that, when desired delay is reset, the value is shown corectly. |
| 16 |
# - Verify that `privilege_checks_user` is initialized to `NULL`. |
| 17 |
# |
| 18 |
# ==== Related Worklog ==== |
| 19 |
# |
| 20 |
# WL#3656: PERFORMANCE SCHEMA table for SHOW SLAVE STATUS |
| 21 |
# WL#12966 Replication with Restricted Privileges |
| 22 |
|
| 23 |
--source include/not_have_privilege_checks_user.inc |
| 24 |
source include/master-slave.inc; |
| 25 |
source include/have_binlog_format_mixed.inc; |
| 26 |
|
| 27 |
let $assert_text= On master, the table should return an empty set.; |
| 28 |
let $assert_cond= [select count(*) from performance_schema.replication_applier_configuration] = 0; |
| 29 |
source include/assert.inc; |
| 30 |
|
| 31 |
--connection slave |
| 32 |
|
| 33 |
--echo |
| 34 |
--echo # Verify that SELECT works and produces an output similar to |
| 35 |
--echo # the corresponding field in SHOW SLAVE STATUS(SSS) in all scenarios. |
| 36 |
--echo |
| 37 |
|
| 38 |
--echo |
| 39 |
--echo # Verify that output is same as SSS on a fresh slave. |
| 40 |
--echo |
| 41 |
|
| 42 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 43 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 44 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 45 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 46 |
source include/assert.inc; |
| 47 |
|
| 48 |
--echo |
| 49 |
--echo # Verify that the value of this field is correct after STOP SLAVE. |
| 50 |
--echo |
| 51 |
|
| 52 |
source include/stop_slave.inc; |
| 53 |
|
| 54 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 55 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 56 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 57 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 58 |
source include/assert.inc; |
| 59 |
|
| 60 |
--echo |
| 61 |
--echo # Verify that, when desired delay is set, the value is shown corectly. |
| 62 |
--echo |
| 63 |
|
| 64 |
eval CHANGE REPLICATION SOURCE to SOURCE_DELAY= 2; |
| 65 |
source include/start_slave.inc; |
| 66 |
|
| 67 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 68 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 69 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 70 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 71 |
source include/assert.inc; |
| 72 |
|
| 73 |
--echo |
| 74 |
--echo # Verify that the value is preserved after STOP SLAVE. |
| 75 |
--echo |
| 76 |
|
| 77 |
source include/stop_slave.inc; |
| 78 |
|
| 79 |
let $ss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 80 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 81 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 82 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 83 |
source include/assert.inc; |
| 84 |
|
| 85 |
--echo |
| 86 |
--echo # Verify that, when desired delay is reset, the value is shown corectly. |
| 87 |
--echo |
| 88 |
|
| 89 |
eval CHANGE REPLICATION SOURCE to SOURCE_DELAY= 0; |
| 90 |
source include/start_slave.inc; |
| 91 |
|
| 92 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 93 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 94 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 95 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 96 |
source include/assert.inc; |
| 97 |
|
| 98 |
--echo |
| 99 |
--echo # Verify that `privilege_checks_user` is initialized to `NULL`. |
| 100 |
--echo |
| 101 |
|
| 102 |
let $ps_value= query_get_value(select Privilege_Checks_User from performance_schema.replication_applier_configuration, Privilege_Checks_User, 1); |
| 103 |
let $assert_text= Value for Privilege_Checks_User is initialized to NULL; |
| 104 |
let $assert_cond= "NULL" = "$ps_value"; |
| 105 |
source include/assert.inc; |
| 106 |
|
| 107 |
--echo |
| 108 |
--echo # Verify that `require_row_format` is initialized to `NO`. |
| 109 |
--echo |
| 110 |
|
| 111 |
let $ps_value= query_get_value(select Require_Row_Format from performance_schema.replication_applier_configuration, Require_Row_Format, 1); |
| 112 |
let $assert_text= Value for Require_Row_Format is initialized to NO; |
| 113 |
let $assert_cond= "NO" = "$ps_value"; |
| 114 |
source include/assert.inc; |
| 115 |
|
| 116 |
--echo |
| 117 |
--echo # Verify that `require_table_primary_key_check` is initialized to `STREAM`. |
| 118 |
--echo |
| 119 |
|
| 120 |
let $ps_value= query_get_value(select Require_Table_Primary_Key_Check from performance_schema.replication_applier_configuration, Require_Table_Primary_Key_Check, 1); |
| 121 |
let $assert_text= Value for Require_Table_Primary_Key_Check is initialized to STREAM; |
| 122 |
let $assert_cond= "STREAM" = "$ps_value"; |
| 123 |
source include/assert.inc; |
| 124 |
|
| 125 |
--echo |
| 126 |
--echo # Verify that `assign_gtids_to_anonymous_transactions_type` is initialized to `OFF`. |
| 127 |
--echo |
| 128 |
|
| 129 |
let $ps_value= query_get_value(select Assign_gtids_to_anonymous_transactions_type from performance_schema.replication_applier_configuration, Assign_gtids_to_anonymous_transactions_type, 1); |
| 130 |
let $assert_text= Value for Assign_gtids_to_anonymous_transactions_type is initialized to OFF; |
| 131 |
let $assert_cond= "OFF" = "$ps_value"; |
| 132 |
source include/assert.inc; |
| 133 |
|
| 134 |
--echo |
| 135 |
--echo # Verify that `assign_gtids_to_anonymous_transactions_value` is initialized to NULL. |
| 136 |
--echo |
| 137 |
|
| 138 |
let $ps_value= query_get_value(select Assign_gtids_to_anonymous_transactions_value from performance_schema.replication_applier_configuration, Assign_gtids_to_anonymous_transactions_value, 1); |
| 139 |
let $assert_text= Value for Assign_gtids_to_anonymous_transactions_value is initialized to NULL; |
| 140 |
let $assert_cond= "NULL" = "$ps_value"; |
| 141 |
source include/assert.inc; |
| 142 |
|
| 143 |
source include/rpl_end.inc; |