Debian Codegraph @

mysql-test/suite/sys_vars/t/binlog_row_metadata_basic.test

raw
1 ################## mysql-test\t\binlog_row_metadata_basic.test ################
2 # #
3 # Variable Name: binlog_row_metadata #
4 # Scope: Global #
5 # Data Type: enumeration #
6 # #
7 # Creation Date: 2017-01-23 #
8 # Author : Libing Song #
9 # #
10 # #
11 # Description:Test Cases of Dynamic System Variable binlog_row_metadata #
12 # that checks the behavior of this variable in the following ways #
13 # * Value Check #
14 # * Scope Check #
15 # #
16 # Reference: #
17 # http://dev.mysql.com/doc/refman/8.X/en/server-system-variables.html #
18 # #
19 ###############################################################################
20
21
22 --echo NO_LOG Expected
23 SELECT @@GLOBAL.binlog_row_metadata;
24 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
25 SELECT @@SESSION.binlog_row_metadata;
26
27 --echo '#---------------------BS_STVARS_002_01----------------------#'
28 ####################################################################
29 # Displaying default value #
30 ####################################################################
31 SET @start_value= @@global.binlog_row_metadata;
32
33 SELECT COUNT(@@GLOBAL.binlog_row_metadata);
34 --echo 1 Expected
35
36 --echo '#---------------------BS_STVARS_002_02----------------------#'
37 ####################################################################
38 # Check if Value can set #
39 ####################################################################
40 SET @@GLOBAL.binlog_row_metadata=0;
41 SELECT @@GLOBAL.binlog_row_metadata;
42 --echo NO_LOG Expected
43
44 SET @@GLOBAL.binlog_row_metadata=1;
45 SELECT @@GLOBAL.binlog_row_metadata;
46 --echo MINIMAL Expected
47
48 SET @@GLOBAL.binlog_row_metadata=2;
49 SELECT @@GLOBAL.binlog_row_metadata;
50 --echo FULL Expected
51
52 SET @@GLOBAL.binlog_row_metadata=NO_LOG;
53 SELECT @@GLOBAL.binlog_row_metadata;
54 --echo NO_LOG Expected
55
56 SET @@GLOBAL.binlog_row_metadata=MINIMAL;
57 SELECT @@GLOBAL.binlog_row_metadata;
58 --echo MINIMAL Expected
59
60 SET @@GLOBAL.binlog_row_metadata=FULL;
61 SELECT @@GLOBAL.binlog_row_metadata;
62 --echo FULL Expected
63
64 SET @@GLOBAL.binlog_row_metadata='NO_LOG';
65 SELECT @@GLOBAL.binlog_row_metadata;
66 --echo NO_LOG Expected
67
68 SET @@GLOBAL.binlog_row_metadata='MINIMAL';
69 SELECT @@GLOBAL.binlog_row_metadata;
70 --echo MINIMAL Expected
71
72 SET @@GLOBAL.binlog_row_metadata='FULL';
73 SELECT @@GLOBAL.binlog_row_metadata;
74 --echo FULL Expected
75
76 --echo '#---------------------BS_STVARS_002_03----------------------#'
77 #################################################################
78 # Check if the value in GLOBAL Table matches value in variable #
79 #################################################################
80
81 SET @@GLOBAL.binlog_row_metadata='MINIMAl';
82 SELECT *
83 FROM information_schema.global_variables
84 WHERE VARIABLE_NAME='binlog_row_metadata';
85
86 --echo '#---------------------BS_STVARS_002_04----------------------#'
87 #################################################################
88 # Check if the value in SESSION Table matches value in variable #
89 #################################################################
90
91 SELECT *
92 FROM information_schema.session_variables
93 WHERE VARIABLE_NAME LIKE 'binlog_row_metadata';
94
95 --echo '#---------------------BS_STVARS_002_05----------------------#'
96 ################################################################################
97 # Check if binlog_row_metadata can be accessed with and without @@ sign #
98 ################################################################################
99
100 SELECT COUNT(@@binlog_row_metadata);
101 --echo 1 Expected
102 SELECT COUNT(@@GLOBAL.binlog_row_metadata);
103 --echo 1 Expected
104
105 --echo '#---------------------BS_STVARS_002_06----------------------#'
106 ################################################################################
107 # Check if binlog_row_metadata can handle invalid values correctly #
108 ################################################################################
109 --error ER_WRONG_VALUE_FOR_VAR
110 SET GLOBAL binlog_row_metadata = full1;
111
112 --error ER_WRONG_VALUE_FOR_VAR
113 SET GLOBAL binlog_row_metadata = "full1";
114
115 --error ER_WRONG_VALUE_FOR_VAR
116 SET GLOBAL binlog_row_metadata = 3;
117
118 --error ER_WRONG_VALUE_FOR_VAR
119 SET GLOBAL binlog_row_metadata = -1;
120
121 SET @@global.binlog_row_metadata= @start_value;