← Back
Editing: replication_optimize_for_static_plugin_config.test
# Variable Name: replication_optimize_for_static_plugin_config # Scope: Global # Access Type: Static # Data Type: boolean # # Creation Date: 2019-12-22 # Author : Pedro Figueiredo --source include/not_embedded.inc --source include/have_semisync_plugin.inc --let $saved_global_replication_optimize_for_static_plugin_config = `SELECT @@global.replication_optimize_for_static_plugin_config` #################################################################### # Displaying default value # #################################################################### --let $assert_text = Default GLOBAL value is FALSE --let $assert_cond = [SELECT @@global.replication_optimize_for_static_plugin_config = 0] --source include/assert.inc #################################################################### # Check if Value can set and that P_S reports the correct value # #################################################################### # 1, TRUE, ON, 0, FALSE, OFF --let $j=6 while($j>0) { if ($j == 6) { --let $to_set = OFF --let $expected = OFF } if ($j == 5) { --let $to_set = FALSE --let $expected = OFF } if ($j == 4) { --let $to_set = 0 --let $expected = OFF } if ($j == 3) { --let $to_set = ON --let $expected = ON } if ($j == 2) { --let $to_set = TRUE --let $expected = ON } if ($j == 1) { --let $to_set = 1 --let $expected = ON } --let $scope = GLOBAL --let $ps_table = global_variables --eval SET @@$scope.replication_optimize_for_static_plugin_config = $to_set --let $reported=`SELECT variable_value FROM performance_schema.$ps_table WHERE variable_name = 'replication_optimize_for_static_plugin_config'` --let $assert_text= Reported value matches the one set (set $to_set in $scope scope) --let $assert_cond = "$reported" = "$expected" --source include/assert.inc --dec $j } #################################################################### # Privileges # #################################################################### CREATE USER user1; --connect(conn_user1,localhost,user1,,) # assert that one cannot change the value without privileges --error ER_SPECIFIC_ACCESS_DENIED_ERROR SET GLOBAL replication_optimize_for_static_plugin_config = 1; # assert that one can change the value if SUPER is given --connection default GRANT SUPER ON *.* TO user1@'%'; FLUSH PRIVILEGES; --connect(conn2_user1,localhost,user1,,) SET GLOBAL replication_optimize_for_static_plugin_config = 1; --connection default DROP USER user1; #################################################################### # Transactional context # #################################################################### BEGIN; # can change the variable's value in global scope while inside a transaction SET GLOBAL replication_optimize_for_static_plugin_config = ON; ROLLBACK; #################################################################### # SQL statement # #################################################################### SET GLOBAL replication_optimize_for_static_plugin_config = 1; --replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_LIB --eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN' UNINSTALL PLUGIN rpl_semi_sync_master; --let $plugin_count= `SELECT COUNT(*) FROM information_schema.plugins WHERE plugin_name = 'rpl_semi_sync_master' AND plugin_status = 'DELETED'` --let $assert_cond= $plugin_count = 1 --let $assert_text= Semi-sync not disposed because it is in use --source include/assert.inc SET GLOBAL replication_optimize_for_static_plugin_config = 0; --let $plugin_count= `SELECT COUNT(*) FROM information_schema.plugins WHERE plugin_name = 'rpl_semi_sync_master' AND plugin_status = 'DELETED'` --let $assert_cond= $plugin_count = 0 --let $assert_text= Semi-sync disposed because it is no longer in use --source include/assert.inc --replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_LIB --eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN' UNINSTALL PLUGIN rpl_semi_sync_master; --let $plugin_count= `SELECT COUNT(*) FROM information_schema.plugins WHERE plugin_name = 'rpl_semi_sync_master' AND plugin_status = 'DELETED'` --let $assert_cond= $plugin_count = 0 --let $assert_text= Semi-sync disposed because it is no longer in use --source include/assert.inc #################################################################### # End of tests # #################################################################### --eval SET @@global.replication_optimize_for_static_plugin_config = $saved_global_replication_optimize_for_static_plugin_config
Save File
Cancel