MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
myisam_max_sort_file_size_basic.inc
1 
2 ############## mysql-test\t\myisam_max_sort_file_size_basic.test ################
3 # #
4 # Variable Name: myisam_max_sort_file_size #
5 # Scope: GLOBAL & SESSION #
6 # Access Type: Dynamic #
7 # Data Type: Numeric #
8 # Default Value: 1 #
9 # Range: 1 - 65536 #
10 # #
11 # #
12 # Creation Date: 2008-02-07 #
13 # Author: Rizwan Maredia #
14 # #
15 # Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size #
16 # that checks the behavior of this variable in the following ways #
17 # * Default Value #
18 # * Valid & Invalid values #
19 # * Scope & Access method #
20 # * Data Integrity #
21 # #
22 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
23 # server-system-variables.html #
24 # #
25 ################################################################################
26 
27 --source include/load_sysvars.inc
28 
29 ###################################################################
30 # START OF myisam_max_sort_file_size TESTS #
31 ###################################################################
32 
33 
34 #############################################################
35 # Save initial value #
36 #############################################################
37 
38 SET @start_global_value = @@global.myisam_max_sort_file_size;
39 SELECT @start_global_value;
40 
41 --echo '#--------------------FN_DYNVARS_094_01-------------------------#'
42 ###################################################################
43 # Display the DEFAULT value of myisam_max_sort_file_size #
44 ###################################################################
45 
46 SET @@global.myisam_max_sort_file_size = 500000;
47 SET @@global.myisam_max_sort_file_size = DEFAULT;
48 SELECT @@global.myisam_max_sort_file_size;
49 
50 --echo '#--------------------FN_DYNVARS_094_02-------------------------#'
51 ###################################################################
52 # Check the DEFAULT value of myisam_max_sort_file_size #
53 ###################################################################
54 
55 SET @@global.myisam_max_sort_file_size = DEFAULT;
56 SELECT @@global.myisam_max_sort_file_size = 2147483648;
57 
58 --echo '#--------------------FN_DYNVARS_094_03-------------------------#'
59 ##################################################################################
60 # Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope #
61 ##################################################################################
62 
63 SET @@global.myisam_max_sort_file_size = 0;
64 SELECT @@global.myisam_max_sort_file_size;
65 SET @@global.myisam_max_sort_file_size = 1024;
66 SELECT @@global.myisam_max_sort_file_size;
67 SET @@global.myisam_max_sort_file_size = 123456789;
68 SELECT @@global.myisam_max_sort_file_size;
69 SET @@global.myisam_max_sort_file_size = 2147483648*2;
70 SELECT @@global.myisam_max_sort_file_size;
71 SET @@global.myisam_max_sort_file_size = 2147483648*1024;
72 SELECT @@global.myisam_max_sort_file_size;
73 SELECT @@global.myisam_max_sort_file_size;
74 SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
75 
76 --echo '#--------------------FN_DYNVARS_094_04-------------------------#'
77 #################################################################################
78 # Check if variable can be access with session scope #
79 #################################################################################
80 
81 --Error ER_GLOBAL_VARIABLE
82 SET @@myisam_max_sort_file_size = 2;
83 
84 --Error ER_GLOBAL_VARIABLE
85 SET @@session.myisam_max_sort_file_size = 3;
86 
87 --Error ER_GLOBAL_VARIABLE
88 SET @@local.myisam_max_sort_file_size = 4;
89 
90 
91 
92 --echo '#------------------FN_DYNVARS_094_05-----------------------#'
93 ####################################################################
94 # Change the value of myisam_max_sort_file_size to an invalid value #
95 ####################################################################
96 
97 SET @@global.myisam_max_sort_file_size = -1;
98 SELECT @@global.myisam_max_sort_file_size;
99 SET @@global.myisam_max_sort_file_size = -2147483648;
100 SELECT @@global.myisam_max_sort_file_size;
101 SET @@global.myisam_max_sort_file_size = -2147483649;
102 SELECT @@global.myisam_max_sort_file_size;
103 --Error ER_WRONG_TYPE_FOR_VAR
104 SET @@global.myisam_max_sort_file_size = 65530.34;
105 SELECT @@global.myisam_max_sort_file_size;
106 --Error ER_WRONG_TYPE_FOR_VAR
107 SET @@global.myisam_max_sort_file_size = 2147483649.56;
108 SELECT @@global.myisam_max_sort_file_size;
109 --Error ER_WRONG_TYPE_FOR_VAR
110 SET @@global.myisam_max_sort_file_size = 1G;
111 
112 --echo '#------------------FN_DYNVARS_094_06-----------------------#'
113 ####################################################################
114 # Check if the value in GLOBAL Table matches value in variable #
115 ####################################################################
116 
117 SET @@global.myisam_max_sort_file_size = 3000;
118 SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE
119 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
120 WHERE VARIABLE_NAME='myisam_max_sort_file_size';
121 
122 
123 --echo '#------------------FN_DYNVARS_094_07-----------------------#'
124 ###########################################################################
125 # Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
126 ###########################################################################
127 
128 SELECT count(VARIABLE_VALUE)
129 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
130 WHERE VARIABLE_NAME='myisam_max_sort_file_size';
131 
132 
133 --echo '#------------------FN_DYNVARS_094_08-----------------------#'
134 ####################################################################
135 # Check if TRUE and FALSE values can be used on variable #
136 ####################################################################
137 
138 SET @@global.myisam_max_sort_file_size = TRUE;
139 SELECT @@global.myisam_max_sort_file_size;
140 SET @@global.myisam_max_sort_file_size = FALSE;
141 SELECT @@global.myisam_max_sort_file_size;
142 
143 
144 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
145 #################################################################################
146 # Check if accessing variable with and without GLOBAL point to same variable #
147 #################################################################################
148 
149 
150 SET @@global.myisam_max_sort_file_size = 512;
151 SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
152 
153 
154 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
155 ##################################################################################
156 # Check if myisam_max_sort_file_size can be accessed without @@ sign and scope #
157 ##################################################################################
158 
159 --Error ER_GLOBAL_VARIABLE
160 SET myisam_max_sort_file_size = 2048;
161 --Error ER_BAD_FIELD_ERROR
162 SELECT myisam_max_sort_file_size;
163 
164 SELECT @@myisam_max_sort_file_size;
165 
166 #verifying another syntax for setting value#
167 SET global myisam_max_sort_file_size = 64;
168 
169 ####################################
170 # Restore initial value #
171 ####################################
172 
173 SET @@global.myisam_max_sort_file_size = @start_global_value;
174 SELECT @@global.myisam_max_sort_file_size;
175 
176 ########################################################
177 # END OF myisam_max_sort_file_size TESTS #
178 ########################################################
179