Debian Codegraph @

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

raw
1 ##################### mysql-test\t\binlog_order_commits_basic.test #############
2 # #
3 # Variable Name: binlog_order_commits #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: BOOLEAN #
7 # Default Value: FALSE #
8 # Valid Values: TRUE, FALSE #
9 # #
10 # #
11 # Creation Date: 2012-05-10 #
12 # Author: Nuno Carvalho #
13 # #
14 # Description: Test Cases of Dynamic System Variable "binlog_order_commits" #
15 # that checks behavior of this variable in the following ways #
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Data Integrity #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-options.html#option_mysqld_event-scheduler #
23 # #
24 ################################################################################
25
26 --source include/load_sysvars.inc
27
28 ###########################################################
29 # START OF binlog_order_commits TESTS #
30 ###########################################################
31
32
33 ############################################################################
34 # Saving initial value of binlog_order_commits in a temporary variable #
35 ############################################################################
36
37 SET @start_value = @@global.binlog_order_commits;
38 SELECT @start_value;
39
40
41 --echo '#---------------------FN_DYNVARS_004_01-------------------------#'
42 ###############################################
43 # Verify default value of variable #
44 ###############################################
45
46 SET @@global.binlog_order_commits = DEFAULT;
47 SELECT @@global.binlog_order_commits = FALSE;
48
49
50 --echo '#--------------------FN_DYNVARS_004_02------------------------#'
51 ######################################################################
52 # Change the value of binlog_order_commits to a valid value #
53 ######################################################################
54
55 SET @@global.binlog_order_commits = ON;
56 SELECT @@global.binlog_order_commits;
57 SET @@global.binlog_order_commits = OFF;
58 SELECT @@global.binlog_order_commits;
59
60 --echo '#--------------------FN_DYNVARS_004_03-------------------------#'
61 ######################################################################
62 # Change the value of binlog_order_commits to invalid value #
63 ######################################################################
64
65 --Error ER_WRONG_VALUE_FOR_VAR
66 SET @@global.binlog_order_commits = 2;
67 --Error ER_WRONG_VALUE_FOR_VAR
68 SET @@global.binlog_order_commits = -1;
69 --Error ER_WRONG_VALUE_FOR_VAR
70 SET @@global.binlog_order_commits = TRUEF;
71 --Error ER_WRONG_VALUE_FOR_VAR
72 SET @@global.binlog_order_commits = TRUE_F;
73 --Error ER_WRONG_VALUE_FOR_VAR
74 SET @@global.binlog_order_commits = FALSE0;
75 --Error ER_WRONG_VALUE_FOR_VAR
76 SET @@global.binlog_order_commits = OON;
77 --Error ER_WRONG_VALUE_FOR_VAR
78 SET @@global.binlog_order_commits = ONN;
79 --Error ER_WRONG_VALUE_FOR_VAR
80 SET @@global.binlog_order_commits = OOFF;
81 --Error ER_WRONG_VALUE_FOR_VAR
82 SET @@global.binlog_order_commits = 0FF;
83 --Error ER_WRONG_VALUE_FOR_VAR
84 SET @@global.binlog_order_commits = ' ';
85 --Error ER_WRONG_VALUE_FOR_VAR
86 SET @@global.binlog_order_commits = " ";
87 --Error ER_WRONG_VALUE_FOR_VAR
88 SET @@global.binlog_order_commits = '';
89
90
91 --echo '#-------------------FN_DYNVARS_004_04----------------------------#'
92 ########################################################################
93 # Test if accessing session binlog_order_commits gives error #
94 ########################################################################
95
96 --Error ER_GLOBAL_VARIABLE
97 SET @@session.binlog_order_commits = OFF;
98 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
99 SELECT @@session.binlog_order_commits;
100
101
102 --echo '#----------------------FN_DYNVARS_004_05------------------------#'
103 ##############################################################################
104 # Check if the value in GLOBAL Tables matches values in variable #
105 ##############################################################################
106
107 --disable_warnings
108 SELECT IF(@@global.binlog_order_commits, "ON", "OFF") = VARIABLE_VALUE
109 FROM performance_schema.global_variables
110 WHERE VARIABLE_NAME='binlog_order_commits';
111 --enable_warnings
112
113
114 --echo '#---------------------FN_DYNVARS_004_06----------------------#'
115 ################################################################
116 # Check if 0 and 1 values can be used on variable #
117 ################################################################
118
119 SET @@global.binlog_order_commits = 0;
120 SELECT @@global.binlog_order_commits;
121 SET @@global.binlog_order_commits = 1;
122 SELECT @@global.binlog_order_commits;
123
124 --echo '#---------------------FN_DYNVARS_004_07----------------------#'
125 ###################################################################
126 # Check if TRUE and FALSE values can be used on variable #
127 ###################################################################
128
129 SET @@global.binlog_order_commits = TRUE;
130 SELECT @@global.binlog_order_commits;
131 SET @@global.binlog_order_commits = FALSE;
132 SELECT @@global.binlog_order_commits;
133
134 --echo '#---------------------FN_DYNVARS_004_08----------------------#'
135 ##############################################################################
136 # Check if accessing variable with SESSION,LOCAL and without SCOPE points #
137 # to same session variable #
138 ##############################################################################
139
140 SET @@global.binlog_order_commits = ON;
141 SELECT @@binlog_order_commits = @@global.binlog_order_commits;
142
143 --echo '#---------------------FN_DYNVARS_004_09----------------------#'
144 ######################################################################
145 # Check if binlog_order_commits can be accessed with and without @@ sign #
146 ######################################################################
147 --Error ER_GLOBAL_VARIABLE
148 SET binlog_order_commits = ON;
149 --Error ER_PARSE_ERROR
150 SET local.binlog_order_commits = OFF;
151 --Error ER_UNKNOWN_TABLE
152 SELECT local.binlog_order_commits;
153 --Error ER_PARSE_ERROR
154 SET global.binlog_order_commits = ON;
155 --Error ER_UNKNOWN_TABLE
156 SELECT global.binlog_order_commits;
157 --Error ER_BAD_FIELD_ERROR
158 SELECT binlog_order_commits;
159 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
160 SELECT @@session.binlog_order_commits;
161
162
163
164 ##############################
165 # Restore initial value #
166 ##############################
167
168 SET @@global.binlog_order_commits = @start_value;
169 SELECT @@global.binlog_order_commits;
170
171
172 ####################################################
173 # END OF binlog_order_commits TESTS #
174 ####################################################