Debian Codegraph @

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

raw
1 ############## mysql-test\t\sql_big_selects_basic.test ########################
2 # #
3 # Variable Name: sql_big_selects #
4 # Scope: SESSION #
5 # Access Type: Dynamic #
6 # Data Type: boolean #
7 # Default Value: #
8 # Range: 0,1 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Rizwan #
13 # #
14 # Description: Test Cases of Dynamic System Variable sql_big_selects #
15 # that checks the 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-system-variables.html #
23 # #
24 ###############################################################################
25
26 --source include/load_sysvars.inc
27
28 ########################################################################
29 # START OF sql_big_selects TESTS #
30 ########################################################################
31
32
33 ################################################################################
34 # Saving initial value of sql_big_selects in a temporary variable #
35 ################################################################################
36
37 SET @session_start_value = @@session.sql_big_selects;
38 SELECT @session_start_value;
39
40 --echo '#--------------------FN_DYNVARS_153_01------------------------#'
41 ########################################################################
42 # Display the DEFAULT value of sql_big_selects #
43 ########################################################################
44
45 SET @@session.sql_big_selects = 0;
46 SET @@session.sql_big_selects = DEFAULT;
47 SELECT @@session.sql_big_selects;
48
49
50 --echo '#---------------------FN_DYNVARS_153_02-------------------------#'
51 #############################################################################
52 # Check if sql_big_selects can be accessed with and without @@ sign #
53 #############################################################################
54
55 SET sql_big_selects = 1;
56 SELECT @@sql_big_selects;
57
58 --Error ER_UNKNOWN_TABLE
59 SELECT session.sql_big_selects;
60
61 --Error ER_UNKNOWN_TABLE
62 SELECT local.sql_big_selects;
63
64 SET session sql_big_selects = 0;
65 SELECT @@session.sql_big_selects;
66
67
68 --echo '#--------------------FN_DYNVARS_153_03------------------------#'
69 #####################################################################
70 # change the value of sql_big_selects to a valid value #
71 #####################################################################
72
73 SET @@session.sql_big_selects = 0;
74 SELECT @@session.sql_big_selects;
75 SET @@session.sql_big_selects = 1;
76 SELECT @@session.sql_big_selects;
77
78
79 --echo '#--------------------FN_DYNVARS_153_04-------------------------#'
80 ########################################################################
81 # Change the value of sql_big_selects to invalid value #
82 ########################################################################
83
84 --Error ER_WRONG_VALUE_FOR_VAR
85 SET @@session.sql_big_selects = -1;
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@session.sql_big_selects = 2;
88 --Error ER_WRONG_VALUE_FOR_VAR
89 SET @@session.sql_big_selects = "T";
90 --Error ER_WRONG_VALUE_FOR_VAR
91 SET @@session.sql_big_selects = "Y";
92 --Error ER_WRONG_VALUE_FOR_VAR
93 SET @@session.sql_big_selects = TRÜE;
94 --Error ER_WRONG_VALUE_FOR_VAR
95 SET @@session.sql_big_selects = ÕN;
96 --error ER_PARSE_ERROR
97 SET @@session.sql_big_selects = OF;
98 --Error ER_WRONG_VALUE_FOR_VAR
99 SET @@session.sql_big_selects = ÓFF;
100 --Error ER_WRONG_VALUE_FOR_VAR
101 SET @@session.sql_big_selects = '¹';
102 --Error ER_WRONG_VALUE_FOR_VAR
103 SET @@session.sql_big_selects = NO;
104
105
106 --echo '#-------------------FN_DYNVARS_153_05----------------------------#'
107 ########################################################################
108 # Test if accessing global sql_big_selects gives error #
109 ########################################################################
110
111 SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
112 SELECT @@global.sql_big_selects;
113 SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
114
115 --echo '#----------------------FN_DYNVARS_153_06------------------------#'
116 #########################################################################
117 # Check if the value in GLOBAL Table contains variable value #
118 #########################################################################
119
120 --disable_warnings
121 SELECT count(VARIABLE_VALUE)
122 FROM performance_schema.global_variables
123 WHERE VARIABLE_NAME='sql_big_selects';
124 --enable_warnings
125
126 --echo '#----------------------FN_DYNVARS_153_07------------------------#'
127 ########################################################################
128 # Check if the value in GLOBAL Table matches value in variable #
129 ########################################################################
130
131 --disable_warnings
132 SELECT IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
133 FROM performance_schema.session_variables
134 WHERE VARIABLE_NAME='sql_big_selects';
135 --enable_warnings
136 SELECT @@session.sql_big_selects;
137
138 --disable_warnings
139 SELECT VARIABLE_VALUE
140 FROM performance_schema.session_variables
141 WHERE VARIABLE_NAME='sql_big_selects';
142 --enable_warnings
143
144 --echo '#---------------------FN_DYNVARS_153_08-------------------------#'
145 ###################################################################
146 # Check if ON and OFF values can be used on variable #
147 ###################################################################
148
149 SET @@session.sql_big_selects = OFF;
150 SELECT @@session.sql_big_selects;
151 SET @@session.sql_big_selects = ON;
152 SELECT @@session.sql_big_selects;
153
154 --echo '#---------------------FN_DYNVARS_153_09----------------------#'
155 ###################################################################
156 # Check if TRUE and FALSE values can be used on variable #
157 ###################################################################
158
159 SET @@session.sql_big_selects = TRUE;
160 SELECT @@session.sql_big_selects;
161 SET @@session.sql_big_selects = FALSE;
162 SELECT @@session.sql_big_selects;
163
164 ##############################
165 # Restore initial value #
166 ##############################
167
168 SET @@session.sql_big_selects = @session_start_value;
169 SELECT @@session.sql_big_selects;
170
171 ############################################################
172 # END OF sql_big_selects TESTS #
173 ############################################################
174