~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# test variables
3
#
4
--disable_warnings
5
drop table if exists t1,t2;
6
--enable_warnings
7
2415.1.3 by Brian Aker
Fix non-repeatable tests.
8
#Store original
9
set @my_sort_buffer_size	  =@@global.sort_buffer_size;
10
1 by brian
clean slate
11
#
12
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
13
#
14
set @my_max_heap_table_size       =@@global.max_heap_table_size;
15
set @my_max_join_size             =@@global.max_join_size;
1305.1.1 by Eric Day
Switched to using the MySQL protocol by default.
16
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
1 by brian
clean slate
17
set @my_server_id                 =@@global.server_id;
18
set @my_storage_engine            =@@global.storage_engine;
1119.4.7 by Stewart Smith
make variables test not leave state of server in a modified state. i.e. fully
19
set @my_myisam_sort_buffer_size	  =@@global.myisam_sort_buffer_size;
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
20
set @my_tx_isolation	  =@@global.tx_isolation;
1 by brian
clean slate
21
22
# case insensitivity tests (new in 5.0)
23
set @`test`=1;
24
select @test, @`test`, @TEST, @`TEST`, @"teSt";
25
set @TEST=2;
26
select @test, @`test`, @TEST, @`TEST`, @"teSt";
27
set @"tEST"=3;
28
select @test, @`test`, @TEST, @`TEST`, @"teSt";
29
set @`TeST`=4;
30
select @test, @`test`, @TEST, @`TEST`, @"teSt";
31
select @`teST`:=5;
32
select @test, @`test`, @TEST, @`TEST`, @"teSt";
33
34
set @select=2,@t5=1.23456;
35
select @`select`,@not_used;
36
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
37
# Expected result "1e-10", windows returns "1e-010"
38
--replace_result 1e-010 1e-10
39
select @test_int,@test_double,@test_string,@test_string2,@select;
40
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
41
select @test_int,@test_double,@test_string,@test_string2;
42
set @test_int="hellohello",@test_double="hellohello",@test_string="hellohello",@test_string2="hellohello";
43
select @test_int,@test_double,@test_string,@test_string2;
44
set @test_int=null,@test_double=null,@test_string=null,@test_string2=null;
45
select @test_int,@test_double,@test_string,@test_string2;
46
select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
47
explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
48
select @t5;
49
50
#
51
# Test problem with WHERE and variables
52
#
53
620 by Brian Aker
Remove dead rand structures
54
CREATE TABLE t1 (c_id INT NOT NULL, c_name VARCHAR(250), c_country VARCHAR(250), PRIMARY KEY(c_id));
1 by brian
clean slate
55
INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB');
56
SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1;
57
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid;
58
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid OR c_id=666;
59
ALTER TABLE t1 DROP PRIMARY KEY;
60
select * from t1 where c_id=@min_cid OR c_id=@max_cid;
61
drop table t1;
62
63
#
64
# Test system variables
65
#
66
set GLOBAL max_join_size=10;
67
set max_join_size=100;
68
show variables like 'max_join_size';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
69
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
1 by brian
clean slate
70
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
71
show global variables like 'max_join_size';
72
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
73
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
1 by brian
clean slate
74
set GLOBAL max_join_size=2000;
75
show global variables like 'max_join_size';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
76
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
1 by brian
clean slate
77
set max_join_size=DEFAULT;
78
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
79
show variables like 'max_join_size';
80
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
81
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
1 by brian
clean slate
82
set GLOBAL max_join_size=DEFAULT;
83
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
84
show global variables like 'max_join_size';
85
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
86
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
1 by brian
clean slate
87
set @@max_join_size=1000, @@global.max_join_size=2000;
88
select @@local.max_join_size, @@global.max_join_size;
89
select @@identity,  length(@@version)>0;
90
select @@VERSION=version();
91
select last_insert_id(345);
92
explain extended select last_insert_id(345);
93
select @@IDENTITY,last_insert_id(), @@identity;
94
explain extended select @@IDENTITY,last_insert_id(), @@identity;
95
96
set global timed_mutexes=ON;
97
show variables like 'timed_mutexes';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
98
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
1 by brian
clean slate
99
set global timed_mutexes=0;
100
show variables like 'timed_mutexes';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
101
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
1 by brian
clean slate
102
1233.2.1 by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias.
103
set storage_engine=MYISAM, storage_engine="MEMORY";
1 by brian
clean slate
104
show local variables like 'storage_engine';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
105
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
1 by brian
clean slate
106
show global variables like 'storage_engine';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
107
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
1 by brian
clean slate
108
109
set GLOBAL myisam_max_sort_file_size=2000000;
110
show global variables like 'myisam_max_sort_file_size';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
111
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
1 by brian
clean slate
112
set GLOBAL myisam_max_sort_file_size=default;
113
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
show global variables like 'myisam_max_sort_file_size';
115
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
116
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
1 by brian
clean slate
117
1305.1.1 by Eric Day
Switched to using the MySQL protocol by default.
118
set global mysql_protocol_buffer_length=1024;
119
show global variables like 'mysql_protocol_buffer_%';
120
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
121
show global variables like 'mysql_protocol_buffer_%';
122
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
123
set global mysql_protocol_buffer_length=1;
124
show variables like 'mysql_protocol_buffer_length';
971.7.3 by Eric Day
Added net_buffer_length tests back in as oldlibdrizzle_buffer_length tests.
125
#warning 1292
1305.1.1 by Eric Day
Switched to using the MySQL protocol by default.
126
set global mysql_protocol_buffer_length=2000000000;
127
show variables like 'mysql_protocol_buffer_length';
971.7.3 by Eric Day
Added net_buffer_length tests back in as oldlibdrizzle_buffer_length tests.
128
1 by brian
clean slate
129
show variables like '%alloc%';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
130
select * from data_dictionary.session_variables where variable_name like '%alloc%';
1 by brian
clean slate
131
set @@range_alloc_block_size=1024*16;
132
set @@query_alloc_block_size=1024*17+2;
133
set @@query_prealloc_size=1024*18;
134
select @@query_alloc_block_size;
135
show variables like '%alloc%';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
136
select * from data_dictionary.session_variables where variable_name like '%alloc%';
1 by brian
clean slate
137
set @@range_alloc_block_size=default;
138
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
139
show variables like '%alloc%';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
140
select * from data_dictionary.session_variables where variable_name like '%alloc%';
1 by brian
clean slate
141
142
#
143
# Bug #10904 Illegal mix of collations between
144
# a system variable and a constant
145
#
146
SELECT @@version LIKE 'non-existent';
147
SELECT @@version_compile_os LIKE 'non-existent';
148
149
# The following should give errors
150
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
151
--error ER_UNKNOWN_SYSTEM_VARIABLE
1 by brian
clean slate
152
set unknown_variable=1;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
153
--error ER_WRONG_TYPE_FOR_VAR
1 by brian
clean slate
154
set max_join_size="hello";
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
155
--error ER_UNKNOWN_STORAGE_ENGINE
1 by brian
clean slate
156
set storage_engine=UNKNOWN_TABLE_TYPE;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
157
--error ER_NO_DEFAULT
1 by brian
clean slate
158
set GLOBAL storage_engine=DEFAULT;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
159
--error ER_LOCAL_VARIABLE
1 by brian
clean slate
160
set global autocommit=1;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
161
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1 by brian
clean slate
162
select @@global.timestamp;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
163
--error ER_INCORRECT_GLOBAL_LOCAL_VAR 
1 by brian
clean slate
164
set @@version='';
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
165
--error ER_GLOBAL_VARIABLE
1 by brian
clean slate
166
set myisam_max_sort_file_size=100;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
167
--error ER_WRONG_VALUE_FOR_VAR
1 by brian
clean slate
168
set @@SQL_WARNINGS=NULL;
169
170
# Test setting all variables
171
172
set autocommit=1;
620 by Brian Aker
Remove dead rand structures
173
select @@autocommit;
1 by brian
clean slate
174
set bulk_insert_buffer_size=100;
175
set join_buffer_size=100;
176
set last_insert_id=1;
177
set max_allowed_packet=100;
178
set max_heap_table_size=100;
179
set max_join_size=100;
180
set max_sort_length=100;
181
set global max_write_lock_count=100;
789 by Brian Aker
MyISAM fix.
182
set global myisam_sort_buffer_size=100;
1305.1.1 by Eric Day
Switched to using the MySQL protocol by default.
183
set global mysql_protocol_buffer_length=100;
1 by brian
clean slate
184
set read_buffer_size=100;
185
set read_rnd_buffer_size=100;
186
set global server_id=100;
187
set sort_buffer_size=100;
188
set sql_big_selects=1;
189
set sql_buffer_result=1;
190
set sql_select_limit=1;
191
# reset it, so later tests don't get confused
192
set sql_select_limit=default;
193
set sql_warnings=1;
194
set global table_open_cache=100;
195
set storage_engine=myisam;
196
set timestamp=1, timestamp=default;
197
set tmp_table_size=100;
198
set tx_isolation="READ-COMMITTED";
199
200
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
413.2.2 by Brian Aker
Removed UNSIGNED from parser.
201
# expected: check that there is no overflow when 64-bit
1 by brian
clean slate
202
# variables are set
203
204
set global myisam_max_sort_file_size=4294967296;
205
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
206
show global variables like 'myisam_max_sort_file_size';
207
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
208
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
1 by brian
clean slate
209
set global myisam_max_sort_file_size=default;
210
750 by Brian Aker
Bug #311084
211
## Bug #311084
212
## swap
213
##
214
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
215
#set @svc=@@global.myisam_max_sort_file_size, @svj=@@local.max_join_size;
216
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
217
#set @@global.myisam_max_sort_file_size=111,@@local.max_join_size=222;
218
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
219
#set @@global.myisam_max_sort_file_size=@@local.max_join_size,@@local.max_join_size=@@global.myisam_max_sort_file_size;
220
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
221
#set @@global.myisam_max_sort_file_size=@svc, @@local.max_join_size=@svj;
222
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
223
#set @a=1, @b=2;
224
#set @a=@b, @b=@a;
225
#select @a, @b;
1 by brian
clean slate
226
227
#
228
# BUG#4788 show create table provides incorrect statement
229
#
230
# What default width have numeric types?
1063.9.46 by Stewart Smith
variables.test for MyISAM as temp only.
231
create temporary table t1 (
396 by Brian Aker
Cleanup tiny and small int.
232
  c1 int,
233
  c2 int,
620 by Brian Aker
Remove dead rand structures
234
  c3 int,
1 by brian
clean slate
235
  c4 int,
236
  c5 bigint);
237
show create table t1;
238
drop table t1;
239
#
240
# What types and widths have variables?
241
set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0;
1063.9.46 by Stewart Smith
variables.test for MyISAM as temp only.
242
create temporary table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
1 by brian
clean slate
243
show create table t1;
244
drop table t1;
245
246
#
247
# Bug #6958: negative arguments to integer options wrap around
248
#
249
250
SET GLOBAL table_open_cache=-1;
251
SHOW VARIABLES LIKE 'table_open_cache';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
252
SELECT * FROM DATA_DICTIONARY.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
1 by brian
clean slate
253
SET GLOBAL table_open_cache=DEFAULT;
254
255
#
256
# Tests for lc_time_names
257
# Note, when adding new locales, please fix ID accordingly:
258
# - to test the last ID (currently 108)
259
# - and the next after the last (currently 109)
260
#
261
--echo *** Various tests with LC_TIME_NAMES
262
--echo *** LC_TIME_NAMES: testing case insensitivity
263
set @@lc_time_names='ru_ru';
264
select @@lc_time_names;
265
--echo *** LC_TIME_NAMES: testing with a user variable
266
set @lc='JA_JP';
267
set @@lc_time_names=@lc;
268
select @@lc_time_names;
269
--echo *** LC_TIME_NAMES: testing with string expressions
270
set lc_time_names=concat('de','_','DE');
271
select @@lc_time_names;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
272
--error ER_UNKNOWN_ERROR
1 by brian
clean slate
273
set lc_time_names=concat('de','+','DE');
274
select @@lc_time_names;
275
--echo LC_TIME_NAMES: testing with numeric expressions
276
set @@lc_time_names=1+2;
277
select @@lc_time_names;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
278
--error ER_WRONG_TYPE_FOR_VAR
1 by brian
clean slate
279
set @@lc_time_names=1/0;
280
select @@lc_time_names;
281
set lc_time_names=en_US;
282
--echo LC_TIME_NAMES: testing NULL and a negative number:
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
283
--error ER_WRONG_VALUE_FOR_VAR
1 by brian
clean slate
284
set lc_time_names=NULL;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
285
--error ER_UNKNOWN_ERROR
1 by brian
clean slate
286
set lc_time_names=-1;
287
select @@lc_time_names;
288
--echo LC_TIME_NAMES: testing locale with the last ID:
289
set lc_time_names=108;
290
select @@lc_time_names;
291
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
292
--error ER_UNKNOWN_ERROR
1 by brian
clean slate
293
set lc_time_names=109;
294
select @@lc_time_names;
295
--echo LC_TIME_NAMES: testing that 0 is en_US:
296
set lc_time_names=0;
297
select @@lc_time_names;
298
299
#
300
# Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect
301
#
302
select @@global.lc_time_names, @@lc_time_names;
303
set @@global.lc_time_names=fr_FR;
304
select @@global.lc_time_names, @@lc_time_names;
305
--echo New connection
306
connect (con1,localhost,root,,);
307
connection con1;
308
select @@global.lc_time_names, @@lc_time_names;
309
set @@lc_time_names=ru_RU;
310
select @@global.lc_time_names, @@lc_time_names;
311
disconnect con1;
312
connection default;
313
--echo Returnung to default connection
314
select @@global.lc_time_names, @@lc_time_names;
315
set lc_time_names=default;
316
select @@global.lc_time_names, @@lc_time_names;
317
set @@global.lc_time_names=default;
318
select @@global.lc_time_names, @@lc_time_names;
319
set @@lc_time_names=default;
320
select @@global.lc_time_names, @@lc_time_names;
321
322
323
#
324
# Bug #13334: query_prealloc_size default less than minimum
325
#
326
set @test = @@query_prealloc_size;
327
set @@query_prealloc_size = @test;
328
select @@query_prealloc_size = @test;
329
330
--echo End of 4.1 tests
331
332
#
333
# Bug#6282 Packet error with SELECT INTO
334
# 
335
1063.9.46 by Stewart Smith
variables.test for MyISAM as temp only.
336
create temporary table t1 (a int);
1 by brian
clean slate
337
select a into @x from t1;
338
show warnings;
339
drop table t1;
340
341
#
342
# Bug #10339: read only variables.
343
#
344
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
345
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1 by brian
clean slate
346
set @@warning_count=1;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
347
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1 by brian
clean slate
348
set @@global.error_count=1;
349
350
#
351
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
352
#
1194 by Brian Aker
Removed test for ARCH (it only looked at Intel style systems). Left in SELECT for it.
353
--disable_query_log
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
354
select VARIABLE_VALUE from data_dictionary.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
1194 by Brian Aker
Removed test for ARCH (it only looked at Intel style systems). Left in SELECT for it.
355
--enable_query_log
1197 by Brian Aker
Remove test for 32bit max on heap tables.
356
# We technically do not care about 32bit hardware. -Brian
357
#set @@max_heap_table_size= 4294967296;
358
#select @@max_heap_table_size > 0;
359
#set global max_heap_table_size= 4294967296;
360
#select @@max_heap_table_size > 0;
361
#set @@max_heap_table_size= 4294967296;
362
#select @@max_heap_table_size > 0;
1124.2.12 by Diego Medina
finally fixed the 64-bit vs 32-bit test case
363
--enable_warnings
1 by brian
clean slate
364
#
365
# Bug #11775 Variable character_set_system does not exist (sometimes)
366
#
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
367
--error ER_UNKNOWN_SYSTEM_VARIABLE
1 by brian
clean slate
368
select @@character_set_system;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
369
--error ER_UNKNOWN_SYSTEM_VARIABLE
642.1.51 by Lee
enable user_var, user_var-binlog and symlink tests
370
set global character_set_system = utf8;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
371
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1 by brian
clean slate
372
set @@global.version_compile_os='234';
373
374
#
642.1.51 by Lee
enable user_var, user_var-binlog and symlink tests
375
# Check character_set_filesystem variable invalid for Drizzle
1 by brian
clean slate
376
#
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
377
--error ER_UNKNOWN_SYSTEM_VARIABLE
642.1.51 by Lee
enable user_var, user_var-binlog and symlink tests
378
set @@global.character_set_filesystem=utf8;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
379
--error ER_UNKNOWN_SYSTEM_VARIABLE
642.1.51 by Lee
enable user_var, user_var-binlog and symlink tests
380
set character_set_filesystem=utf8;
1 by brian
clean slate
381
382
#
383
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
384
#
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
385
set @sql_big_selects = @@sql_big_selects;
1 by brian
clean slate
386
set @@sql_big_selects = 1;
387
show variables like 'sql_big_selects';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
388
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
389
#select * from data_dictionary.session_variables where variable_name like 'sql_big_selects';
390
set @@sql_big_selects = @sql_big_selects;
1 by brian
clean slate
391
392
#
393
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
394
# sql_notes values
395
# 
396
set @@sql_notes = 0, @@sql_warnings = 0;
397
show variables like 'sql_notes';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
398
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
399
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
1 by brian
clean slate
400
show variables like 'sql_warnings';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
401
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
402
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
1 by brian
clean slate
403
set @@sql_notes = 1, @@sql_warnings = 1;
404
show variables like 'sql_notes';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
405
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
406
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
1 by brian
clean slate
407
show variables like 'sql_warnings';
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
408
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
409
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
1 by brian
clean slate
410
411
#
412
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
413
#
414
# Don't actually output, since it depends on the system
415
--replace_column 1 # 2 # 3 # 4 #
416
select @@version, @@version_comment, @@version_compile_machine,
417
       @@version_compile_os;
418
419
#
420
# Bug #1039: make tmpdir and datadir available as @@variables (also included
421
# basedir)
422
#
423
# Don't actually output, since it depends on the system
424
--replace_column 1 # 2 # 3 #
425
select @@basedir, @@datadir, @@tmpdir;
426
--replace_column 2 #
427
show variables like 'basedir';
428
--replace_column 2 #
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
429
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
430
#select * from data_dictionary.session_variables where variable_name like 'basedir';
1 by brian
clean slate
431
--replace_column 2 #
432
show variables like 'datadir';
433
--replace_column 2 #
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
434
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
435
#select * from data_dictionary.session_variables where variable_name like 'datadir';
1 by brian
clean slate
436
--replace_column 2 #
437
show variables like 'tmpdir';
438
--replace_column 2 #
439
440
#
441
# Bug#20908: Crash if select @@""
442
#
443
--error ER_PARSE_ERROR
444
select @@"";
445
--error ER_PARSE_ERROR
446
select @@&;
447
--error ER_PARSE_ERROR
448
select @@@;
449
450
#
451
# Bug#20166 mysql-test-run.pl does not test system privilege tables creation
452
#
453
# Don't actually output, since it depends on the system
454
--replace_column 1 #
455
select @@hostname;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
456
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1 by brian
clean slate
457
set @@hostname= "anothername";
458
--replace_column 2 #
459
show variables like 'hostname';
460
461
--echo End of 5.0 tests
462
463
# This is at the very after the versioned tests, since it involves doing
464
# cleanup
465
#
466
# Bug #19263: variables.test doesn't clean up after itself (II/II --
467
# restore)
468
#
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
469
--error ER_UNKNOWN_SYSTEM_VARIABLE
1 by brian
clean slate
470
set global flush_time                =@my_flush_time;
471
set global max_heap_table_size       =@my_max_heap_table_size;
472
set global max_join_size             =@my_max_join_size;
473
# No default
474
set global max_write_lock_count      =default;
1305.1.1 by Eric Day
Switched to using the MySQL protocol by default.
475
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
1 by brian
clean slate
476
set global server_id                 =@my_server_id;
477
set global storage_engine            =@my_storage_engine;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
478
--error ER_UNKNOWN_SYSTEM_VARIABLE
1 by brian
clean slate
479
set global thread_cache_size         =@my_thread_cache_size;
1119.4.7 by Stewart Smith
make variables test not leave state of server in a modified state. i.e. fully
480
set global myisam_sort_buffer_size   =@my_myisam_sort_buffer_size;
1 by brian
clean slate
481
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
482
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
483
SHOW LOCAL VARIABLES LIKE 'max_join_size';
484
485
set GLOBAL bulk_insert_buffer_size=DEFAULT;
486
set GLOBAL join_buffer_size=DEFAULT;
487
set GLOBAL max_allowed_packet=DEFAULT;
2415.1.3 by Brian Aker
Fix non-repeatable tests.
488
set GLOBAL max_heap_table_size=@my_max_heap_table_size;
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
489
set GLOBAL max_join_size=DEFAULT;
490
set GLOBAL max_sort_length=DEFAULT;
491
set GLOBAL max_write_lock_count=DEFAULT;
492
set GLOBAL myisam_sort_buffer_size=DEFAULT;
493
set GLOBAL mysql_protocol_buffer_length=DEFAULT;
494
set GLOBAL read_buffer_size=DEFAULT;
495
set GLOBAL read_rnd_buffer_size=DEFAULT;
2415.1.3 by Brian Aker
Fix non-repeatable tests.
496
set global server_id=@my_server_id;
497
set GLOBAL sort_buffer_size=@my_sort_buffer_size;
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
498
set GLOBAL table_open_cache=DEFAULT;
499
set GLOBAL storage_engine= @my_storage_engine;
500
set GLOBAL tmp_table_size=DEFAULT;
501
set GLOBAL tx_isolation= @my_tx_isolation;
502
503
set SESSION bulk_insert_buffer_size=DEFAULT;
504
set SESSION join_buffer_size=DEFAULT;
505
set SESSION max_allowed_packet=DEFAULT;
2415.1.3 by Brian Aker
Fix non-repeatable tests.
506
set SESSION max_heap_table_size=@my_max_heap_table_size;
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
507
set SESSION max_join_size=DEFAULT;
508
set SESSION max_sort_length=DEFAULT;
509
set SESSION read_buffer_size=DEFAULT;
510
set SESSION read_rnd_buffer_size=DEFAULT;
511
set SESSION sort_buffer_size=DEFAULT;
512
set SESSION sql_big_selects=DEFAULT;
513
set SESSION sql_buffer_result=DEFAULT;
514
set SESSION sql_select_limit=DEFAULT;
515
set SESSION sql_warnings=DEFAULT;
516
set SESSION storage_engine= @my_storage_engine;
517
set SESSION tmp_table_size=DEFAULT;
518
set SESSION tx_isolation= @my_tx_isolation;
519
1 by brian
clean slate
520
#
521
# Bug#28580 Repeatation of status variables
522
#
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
523
1 by brian
clean slate
524
--replace_column 2 #
1055.1.2 by Padraig O'Sullivan
Updated test case based on bug fix.
525
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
1487.1.1 by Brian Aker
There is room for improvement around this. We should be using rows as well
526