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 SELECT @@GLOBAL.binlog_row_metadata;
23 --echo MINIMAL Expected
24 --error 1238
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 MINIMAL Expected
43
44 SET @@GLOBAL.binlog_row_metadata=1;
45 SELECT @@GLOBAL.binlog_row_metadata;
46 --echo FULL Expected
47
48 SET @@GLOBAL.binlog_row_metadata=MINIMAL;
49 SELECT @@GLOBAL.binlog_row_metadata;
50 --echo MINIMAL Expected
51
52 SET @@GLOBAL.binlog_row_metadata=FULL;
53 SELECT @@GLOBAL.binlog_row_metadata;
54 --echo FULL 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 --echo '#---------------------BS_STVARS_002_03----------------------#'
65 #################################################################
66 # Check if the value in GLOBAL Table matches value in variable #
67 #################################################################
68
69 --disable_warnings
70 SELECT @@GLOBAL.binlog_row_metadata = VARIABLE_VALUE
71 FROM performance_schema.global_variables
72 WHERE VARIABLE_NAME='binlog_row_metadata';
73 --enable_warnings
74 --echo 1 Expected
75
76 SELECT COUNT(@@GLOBAL.binlog_row_metadata);
77 --echo 1 Expected
78
79 --disable_warnings
80 SELECT COUNT(VARIABLE_VALUE)
81 FROM performance_schema.global_variables
82 WHERE VARIABLE_NAME='binlog_row_metadata';
83 --enable_warnings
84 --echo 1 Expected
85
86
87 --echo '#---------------------BS_STVARS_002_04----------------------#'
88 #################################################################
89 # Check if the value in SESSION Table matches value in variable #
90 #################################################################
91
92 SELECT @@GLOBAL.binlog_row_metadata = VARIABLE_VALUE
93 FROM performance_schema.session_variables
94 WHERE VARIABLE_NAME LIKE 'binlog_row_metadata';
95
96 --echo '#---------------------BS_STVARS_002_05----------------------#'
97 ################################################################################
98 # Check if binlog_row_metadata can be accessed with and without @@ sign #
99 ################################################################################
100
101 SELECT COUNT(@@binlog_row_metadata);
102 --echo 1 Expected
103 SELECT COUNT(@@GLOBAL.binlog_row_metadata);
104 --echo 1 Expected
105
106 --echo '#---------------------BS_STVARS_002_06----------------------#'
107 ################################################################################
108 # Check if binlog_row_metadata can handle invalid values correctly #
109 ################################################################################
110 # Cannot set the value
111 --error 1231
112 SET GLOBAL binlog_row_metadata = full1;
113
114 --error 1231
115 SET GLOBAL binlog_row_metadata = "full1";
116
117 --error 1231
118 SET GLOBAL binlog_row_metadata = 2;
119
120 --error 1231
121 SET GLOBAL binlog_row_metadata = -1;
122
123 SET @@global.binlog_row_metadata= @start_value;
124