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
|
# Variable Name: replication_sender_observe_commit_only
# Scope: Global
# Access Type: Static
# Data Type: boolean
#
# Creation Date: 2019-12-22
# Author : Pedro Figueiredo
--let $saved_global_replication_sender_observe_commit_only = `SELECT @@global.replication_sender_observe_commit_only`
####################################################################
# Displaying default value #
####################################################################
--let $assert_text = Default GLOBAL value is FALSE
--let $assert_cond = [SELECT @@global.replication_sender_observe_commit_only = 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_sender_observe_commit_only = $to_set
--let $reported=`SELECT variable_value FROM performance_schema.$ps_table WHERE variable_name = 'replication_sender_observe_commit_only'`
--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_sender_observe_commit_only = 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_sender_observe_commit_only = 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_sender_observe_commit_only = ON;
ROLLBACK;
####################################################################
# End of tests #
####################################################################
--eval SET @@global.replication_sender_observe_commit_only = $saved_global_replication_sender_observe_commit_only
|