| 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 |
# |
| 17 |
# ==== Related Worklog ==== |
| 18 |
# |
| 19 |
# MDEV-16437: merge 5.7 P_S replication instrumentation and tables |
| 20 |
# |
| 21 |
|
| 22 |
source include/have_perfschema.inc; |
| 23 |
source include/have_binlog_format_mixed.inc; |
| 24 |
source include/master-slave.inc; |
| 25 |
|
| 26 |
let $assert_text= On master, the table should return an empty set.; |
| 27 |
let $assert_cond= count(*) = 0 from performance_schema.replication_applier_configuration; |
| 28 |
source include/assert.inc; |
| 29 |
|
| 30 |
--connection slave |
| 31 |
|
| 32 |
--echo |
| 33 |
--echo # Verify that SELECT works and produces an output similar to |
| 34 |
--echo # the corresponding field in SHOW SLAVE STATUS(SSS) in all scenarios. |
| 35 |
--echo |
| 36 |
|
| 37 |
--echo |
| 38 |
--echo # Verify that output is same as SSS on a fresh slave. |
| 39 |
--echo |
| 40 |
|
| 41 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 42 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 43 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 44 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 45 |
source include/assert.inc; |
| 46 |
|
| 47 |
--echo |
| 48 |
--echo # Verify that the value of this field is correct after STOP SLAVE. |
| 49 |
--echo |
| 50 |
|
| 51 |
source include/stop_slave.inc; |
| 52 |
|
| 53 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 54 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 55 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 56 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 57 |
source include/assert.inc; |
| 58 |
|
| 59 |
--echo |
| 60 |
--echo # Verify that, when desired delay is set, the value is shown corectly. |
| 61 |
--echo |
| 62 |
|
| 63 |
eval change master to master_delay= 2; |
| 64 |
source include/start_slave.inc; |
| 65 |
|
| 66 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 67 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 68 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 69 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 70 |
source include/assert.inc; |
| 71 |
|
| 72 |
--echo |
| 73 |
--echo # Verify that the value is preserved after STOP SLAVE. |
| 74 |
--echo |
| 75 |
|
| 76 |
source include/stop_slave.inc; |
| 77 |
|
| 78 |
let $ss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 79 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 80 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 81 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 82 |
source include/assert.inc; |
| 83 |
|
| 84 |
--echo |
| 85 |
--echo # Verify that, when desired delay is reset, the value is shown corectly. |
| 86 |
--echo |
| 87 |
|
| 88 |
eval change master to master_delay= 0; |
| 89 |
source include/start_slave.inc; |
| 90 |
|
| 91 |
let $sss_value= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1); |
| 92 |
let $ps_value= query_get_value(select Desired_Delay from performance_schema.replication_applier_configuration, Desired_Delay, 1); |
| 93 |
let $assert_text= Value returned by SSS and PS table for Desired_Delay should be same.; |
| 94 |
let $assert_cond= "$sss_value" = "$ps_value"; |
| 95 |
source include/assert.inc; |
| 96 |
|
| 97 |
source include/rpl_end.inc; |