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
|
################## mysql-test\t\binlog_row_metadata_basic.test ################
# #
# Variable Name: binlog_row_metadata #
# Scope: Global #
# Data Type: enumeration #
# #
# Creation Date: 2017-01-23 #
# Author : Libing Song #
# #
# #
# Description:Test Cases of Dynamic System Variable binlog_row_metadata #
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
# #
# Reference: #
# http://dev.mysql.com/doc/refman/8.X/en/server-system-variables.html #
# #
###############################################################################
--echo NO_LOG Expected
SELECT @@GLOBAL.binlog_row_metadata;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.binlog_row_metadata;
--echo '#---------------------BS_STVARS_002_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
SET @start_value= @@global.binlog_row_metadata;
SELECT COUNT(@@GLOBAL.binlog_row_metadata);
--echo 1 Expected
--echo '#---------------------BS_STVARS_002_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
SET @@GLOBAL.binlog_row_metadata=0;
SELECT @@GLOBAL.binlog_row_metadata;
--echo NO_LOG Expected
SET @@GLOBAL.binlog_row_metadata=1;
SELECT @@GLOBAL.binlog_row_metadata;
--echo MINIMAL Expected
SET @@GLOBAL.binlog_row_metadata=2;
SELECT @@GLOBAL.binlog_row_metadata;
--echo FULL Expected
SET @@GLOBAL.binlog_row_metadata=NO_LOG;
SELECT @@GLOBAL.binlog_row_metadata;
--echo NO_LOG Expected
SET @@GLOBAL.binlog_row_metadata=MINIMAL;
SELECT @@GLOBAL.binlog_row_metadata;
--echo MINIMAL Expected
SET @@GLOBAL.binlog_row_metadata=FULL;
SELECT @@GLOBAL.binlog_row_metadata;
--echo FULL Expected
SET @@GLOBAL.binlog_row_metadata='NO_LOG';
SELECT @@GLOBAL.binlog_row_metadata;
--echo NO_LOG Expected
SET @@GLOBAL.binlog_row_metadata='MINIMAL';
SELECT @@GLOBAL.binlog_row_metadata;
--echo MINIMAL Expected
SET @@GLOBAL.binlog_row_metadata='FULL';
SELECT @@GLOBAL.binlog_row_metadata;
--echo FULL Expected
--echo '#---------------------BS_STVARS_002_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
SET @@GLOBAL.binlog_row_metadata='MINIMAl';
SELECT *
FROM information_schema.global_variables
WHERE VARIABLE_NAME='binlog_row_metadata';
--echo '#---------------------BS_STVARS_002_04----------------------#'
#################################################################
# Check if the value in SESSION Table matches value in variable #
#################################################################
SELECT *
FROM information_schema.session_variables
WHERE VARIABLE_NAME LIKE 'binlog_row_metadata';
--echo '#---------------------BS_STVARS_002_05----------------------#'
################################################################################
# Check if binlog_row_metadata can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@binlog_row_metadata);
--echo 1 Expected
SELECT COUNT(@@GLOBAL.binlog_row_metadata);
--echo 1 Expected
--echo '#---------------------BS_STVARS_002_06----------------------#'
################################################################################
# Check if binlog_row_metadata can handle invalid values correctly #
################################################################################
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL binlog_row_metadata = full1;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL binlog_row_metadata = "full1";
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL binlog_row_metadata = 3;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL binlog_row_metadata = -1;
SET @@global.binlog_row_metadata= @start_value;
|