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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
# ==== Purpose ====
#
# This test script serves as the functionality testing for the table
# performance_schema.replication_applier_configuration. Test for ddl and dml
# operations is a part of the perfschema suite. The ddl/dml tests are named:
# 1) ddl_replication_applier_configuration.test and
# 2) dml_replication_applier_configuration.test.
#
# The follwing scenarios are tested in this script:
#
# - Verify that output is same as SSS on a fresh slave.
# - Verify that the value of this field is correct after STOP SLAVE.
# - Verify that, when desired delay is set, the value is shown corectly.
# - Verify that the value is preserved after STOP SLAVE.
# - Verify that, when desired delay is reset, the value is shown corectly.
# - Verify that `privilege_checks_user` is initialized to `NULL`.
#
# ==== Related Worklog ====
#
# WL#3656: PERFORMANCE SCHEMA table for SHOW SLAVE STATUS
# WL#12966 Replication with Restricted Privileges
--source include/not_have_privilege_checks_user.inc
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
let $assert_text= On master, the table should return an empty set.;
let $assert_cond= [select count(*) from performance_schema.replication_applier_configuration] = 0;
source include/assert.inc;
--connection slave
--echo
--echo # Verify that SELECT works and produces an output similar to
--echo # the corresponding field in SHOW SLAVE STATUS(SSS) in all scenarios.
--echo
--echo
--echo # Verify that output is same as SSS on a fresh slave.
--echo
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1);
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1);
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that the value of this field is correct after STOP SLAVE.
--echo
source include/stop_slave.inc;
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1);
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1);
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that, when desired delay is set, the value is shown corectly.
--echo
eval CHANGE REPLICATION SOURCE to SOURCE_DELAY= 2;
source include/start_slave.inc;
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1);
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1);
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that the value is preserved after STOP SLAVE.
--echo
source include/stop_slave.inc;
let $ss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1);
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1);
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that, when desired delay is reset, the value is shown corectly.
--echo
eval CHANGE REPLICATION SOURCE to SOURCE_DELAY= 0;
source include/start_slave.inc;
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1);
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1);
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that `privilege_checks_user` is initialized to `NULL`.
--echo
let $ps_value= query_get_value(select Privilege_Checks_User from performance_schema.replication_applier_configuration, Privilege_Checks_User, 1);
let $assert_text= Value for Privilege_Checks_User is initialized to NULL;
let $assert_cond= "NULL" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that `require_row_format` is initialized to `NO`.
--echo
let $ps_value= query_get_value(select Require_Row_Format from performance_schema.replication_applier_configuration, Require_Row_Format, 1);
let $assert_text= Value for Require_Row_Format is initialized to NO;
let $assert_cond= "NO" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that `require_table_primary_key_check` is initialized to `STREAM`.
--echo
let $ps_value= query_get_value(select Require_Table_Primary_Key_Check from performance_schema.replication_applier_configuration, Require_Table_Primary_Key_Check, 1);
let $assert_text= Value for Require_Table_Primary_Key_Check is initialized to STREAM;
let $assert_cond= "STREAM" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that `assign_gtids_to_anonymous_transactions_type` is initialized to `OFF`.
--echo
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);
let $assert_text= Value for Assign_gtids_to_anonymous_transactions_type is initialized to OFF;
let $assert_cond= "OFF" = "$ps_value";
source include/assert.inc;
--echo
--echo # Verify that `assign_gtids_to_anonymous_transactions_value` is initialized to NULL.
--echo
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);
let $assert_text= Value for Assign_gtids_to_anonymous_transactions_value is initialized to NULL;
let $assert_cond= "NULL" = "$ps_value";
source include/assert.inc;
source include/rpl_end.inc;
|