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