1
############## mysql-test\t\sql_big_selects_basic.test ########################
3
# Variable Name: sql_big_selects #
5
# Access Type: Dynamic #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable sql_big_selects #
15
# that checks the behavior of this variable in the following ways#
17
# * Valid & Invalid values #
18
# * Scope & Access method #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html #
24
###############################################################################
26
--source include/load_sysvars.inc
28
########################################################################
29
# START OF sql_big_selects TESTS #
30
########################################################################
33
################################################################################
34
# Saving initial value of sql_big_selects in a temporary variable #
35
################################################################################
37
SET @session_start_value = @@session.sql_big_selects;
38
SELECT @session_start_value;
40
--echo '#--------------------FN_DYNVARS_153_01------------------------#'
41
########################################################################
42
# Display the DEFAULT value of sql_big_selects #
43
########################################################################
45
SET @@session.sql_big_selects = 0;
46
SET @@session.sql_big_selects = DEFAULT;
47
SELECT @@session.sql_big_selects;
50
--echo '#---------------------FN_DYNVARS_153_02-------------------------#'
51
#############################################################################
52
# Check if sql_big_selects can be accessed with and without @@ sign #
53
#############################################################################
55
SET sql_big_selects = 1;
56
SELECT @@sql_big_selects;
58
--Error ER_UNKNOWN_TABLE
59
SELECT session.sql_big_selects;
61
--Error ER_UNKNOWN_TABLE
62
SELECT local.sql_big_selects;
64
SET session sql_big_selects = 0;
65
SELECT @@session.sql_big_selects;
68
--echo '#--------------------FN_DYNVARS_153_03------------------------#'
69
#####################################################################
70
# change the value of sql_big_selects to a valid value #
71
#####################################################################
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;
79
--echo '#--------------------FN_DYNVARS_153_04-------------------------#'
80
########################################################################
81
# Change the value of sql_big_selects to invalid value #
82
########################################################################
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;
97
SET @@session.sql_big_selects = OF;
98
SELECT @@session.sql_big_selects;
100
--echo 'Bug # 34828: OF is taken as OFF and a value of 0 is set.'
102
--Error ER_WRONG_VALUE_FOR_VAR
103
SET @@session.sql_big_selects = �FF;
104
--Error ER_WRONG_VALUE_FOR_VAR
105
SET @@session.sql_big_selects = '�';
106
--Error ER_WRONG_VALUE_FOR_VAR
107
SET @@session.sql_big_selects = NO;
110
--echo '#-------------------FN_DYNVARS_153_05----------------------------#'
111
########################################################################
112
# Test if accessing global sql_big_selects gives error #
113
########################################################################
115
--Error ER_LOCAL_VARIABLE
116
SET @@global.sql_big_selects = 0;
118
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
119
SELECT @@global.sql_big_selects;
121
--echo '#----------------------FN_DYNVARS_153_06------------------------#'
122
#########################################################################
123
# Check if the value in GLOBAL Table contains variable value #
124
#########################################################################
126
SELECT count(VARIABLE_VALUE)
127
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
128
WHERE VARIABLE_NAME='sql_big_selects';
130
--echo '#----------------------FN_DYNVARS_153_07------------------------#'
131
########################################################################
132
# Check if the value in GLOBAL Table matches value in variable #
133
########################################################################
135
SELECT @@session.sql_big_selects = VARIABLE_VALUE
136
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
137
WHERE VARIABLE_NAME='sql_big_selects';
138
SELECT @@session.sql_big_selects;
140
SELECT VARIABLE_VALUE
141
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
142
WHERE VARIABLE_NAME='sql_big_selects';
144
--echo '#---------------------FN_DYNVARS_153_08-------------------------#'
145
###################################################################
146
# Check if ON and OFF values can be used on variable #
147
###################################################################
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;
154
--echo '#---------------------FN_DYNVARS_153_09----------------------#'
155
###################################################################
156
# Check if TRUE and FALSE values can be used on variable #
157
###################################################################
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;
164
##############################
165
# Restore initial value #
166
##############################
168
SET @@session.sql_big_selects = @session_start_value;
169
SELECT @@session.sql_big_selects;
171
############################################################
172
# END OF sql_big_selects TESTS #
173
############################################################