Debian Codegraph @

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

raw
1 ##################### mysql-test\t\big_tables_basic.test #######################
2 # #
3 # Variable Name: big_tables #
4 # Scope: SESSION #
5 # Access Type: Dynamic #
6 # Data Type: Boolean #
7 # Default Value: NA #
8 # Range: NA #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman Rawala #
13 # #
14 # Description: Test Cases of Dynamic System Variable "big_tables" #
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_big-tables #
23 # #
24 ################################################################################
25
26 --source include/load_sysvars.inc
27
28 ##########################################################
29 # START OF big_tables TESTS #
30 ##########################################################
31
32
33 ##################################################################
34 # Saving initial value of big_tables in a temporary variable #
35 ##################################################################
36
37 SET @start_value = @@big_tables;
38 SELECT @start_value;
39
40 --echo '#--------------------FN_DYNVARS_005_01------------------------#'
41 #############################################################
42 # Display the DEFAULT value of big_tables #
43 #############################################################
44
45 SET @@big_tables = 1;
46 SET @@big_tables = DEFAULT;
47 SELECT @@big_tables;
48
49
50 --echo '#--------------------FN_DYNVARS_005_02------------------------#'
51 #############################################################
52 # Change the value of big_tables to a valid value #
53 #############################################################
54
55 SET @@big_tables = 0;
56 SELECT @@big_tables;
57 SET @@big_tables = 1;
58 SELECT @@big_tables;
59
60
61 --echo '#--------------------FN_DYNVARS_005_03-------------------------#'
62 ###########################################################################
63 # Change the value of big_tables to invalid value #
64 ###########################################################################
65
66 --Error ER_WRONG_VALUE_FOR_VAR
67 SET @@big_tables = 2;
68 --Error ER_WRONG_VALUE_FOR_VAR
69 SET @@big_tables = -1;
70 --Error ER_WRONG_VALUE_FOR_VAR
71 SET @@big_tables = TRUEF;
72 --Error ER_WRONG_VALUE_FOR_VAR
73 SET @@big_tables = TRUE_F;
74 --Error ER_WRONG_VALUE_FOR_VAR
75 SET @@big_tables = FALSE0;
76 --Error ER_WRONG_VALUE_FOR_VAR
77 SET @@big_tables = OON;
78 --Error ER_WRONG_VALUE_FOR_VAR
79 SET @@big_tables = ONN;
80 --Error ER_WRONG_VALUE_FOR_VAR
81 SET @@big_tables = OOFF;
82 --Error ER_WRONG_VALUE_FOR_VAR
83 SET @@big_tables = 0FF;
84 --Error ER_WRONG_VALUE_FOR_VAR
85 SET @@big_tables = ' ';
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@big_tables = " ";
88 --Error ER_WRONG_VALUE_FOR_VAR
89 SET @@big_tables = '';
90
91
92
93 --echo '#-------------------FN_DYNVARS_005_04----------------------------#'
94 ###########################################################################
95 # Test if accessing global big_tables gives error #
96 ###########################################################################
97
98 SET @@global.big_tables = 1-@@global.big_tables;
99 SELECT @@global.big_tables;
100 SET @@global.big_tables = 1-@@global.big_tables;
101
102 --echo '#----------------------FN_DYNVARS_005_05------------------------#'
103 ##############################################################################
104 # Check if the value in SESSION Tables matches values in variable #
105 ##############################################################################
106
107 SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
108 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
109 WHERE VARIABLE_NAME='big_tables';
110
111
112 --echo '#---------------------FN_DYNVARS_005_06----------------------#'
113 ###################################################################
114 # Check if ON and OFF values can be used on variable #
115 ###################################################################
116
117 SET @@big_tables = OFF;
118 SELECT @@big_tables;
119 SET @@big_tables = ON;
120 SELECT @@big_tables;
121
122 --echo '#---------------------FN_DYNVARS_005_07----------------------#'
123 ###################################################################
124 # Check if TRUE and FALSE values can be used on variable #
125 ###################################################################
126
127 SET @@big_tables = TRUE;
128 SELECT @@big_tables;
129 SET @@big_tables = FALSE;
130 SELECT @@big_tables;
131
132
133 --echo '#---------------------FN_DYNVARS_005_08----------------------#'
134 ##############################################################################
135 # Check if accessing variable with SESSION,LOCAL and without SCOPE points #
136 # to same session variable #
137 ##############################################################################
138
139 SET @@big_tables = 0;
140 SELECT @@big_tables = @@session.big_tables;
141 SET @@big_tables = 1;
142 SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables;
143
144 --echo '#---------------------FN_DYNVARS_005_09----------------------#'
145 ##########################################################################
146 # Check if big_tables can be accessed with and without @@ sign #
147 ##########################################################################
148
149 SET big_tables = 1;
150 SELECT @@big_tables;
151 --Error ER_UNKNOWN_TABLE
152 SELECT local.big_tables;
153 --Error ER_UNKNOWN_TABLE
154 SELECT session.big_tables;
155 --Error ER_BAD_FIELD_ERROR
156 select big_tables;
157
158
159 ##############################
160 # Restore initial value #
161 ##############################
162
163 SET @@big_tables = @start_value;
164 SELECT @@big_tables;
165
166
167 #######################################################
168 # END OF big_tables TESTS #
169 #######################################################
170
171