~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-213

« back to all changes in this revision

Viewing changes to mysql-test/t/variables.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_binlog_cache_size         =@@global.binlog_cache_size;
 
12
set @my_connect_timeout           =@@global.connect_timeout;
 
13
set @my_flush                     =@@global.flush;
 
14
set @my_flush_time                =@@global.flush_time;
 
15
set @my_key_buffer_size           =@@global.key_buffer_size;
 
16
set @my_max_binlog_cache_size     =@@global.max_binlog_cache_size;
 
17
set @my_max_binlog_size           =@@global.max_binlog_size;
 
18
set @my_max_connect_errors        =@@global.max_connect_errors;
 
19
set @my_max_connections           =@@global.max_connections;
 
20
set @my_max_heap_table_size       =@@global.max_heap_table_size;
 
21
set @my_max_join_size             =@@global.max_join_size;
 
22
set @my_myisam_data_pointer_size  =@@global.myisam_data_pointer_size;
 
23
set @my_net_buffer_length         =@@global.net_buffer_length;
 
24
set @my_net_write_timeout         =@@global.net_write_timeout;
 
25
set @my_net_read_timeout          =@@global.net_read_timeout;
 
26
set @my_rpl_recovery_rank         =@@global.rpl_recovery_rank;
 
27
set @my_server_id                 =@@global.server_id;
 
28
set @my_slow_launch_time          =@@global.slow_launch_time;
 
29
set @my_storage_engine            =@@global.storage_engine;
 
30
set @my_thread_cache_size         =@@global.thread_cache_size;
 
31
 
 
32
# case insensitivity tests (new in 5.0)
 
33
set @`test`=1;
 
34
select @test, @`test`, @TEST, @`TEST`, @"teSt";
 
35
set @TEST=2;
 
36
select @test, @`test`, @TEST, @`TEST`, @"teSt";
 
37
set @"tEST"=3;
 
38
select @test, @`test`, @TEST, @`TEST`, @"teSt";
 
39
set @`TeST`=4;
 
40
select @test, @`test`, @TEST, @`TEST`, @"teSt";
 
41
select @`teST`:=5;
 
42
select @test, @`test`, @TEST, @`TEST`, @"teSt";
 
43
 
 
44
set @select=2,@t5=1.23456;
 
45
select @`select`,@not_used;
 
46
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
 
47
# Expected result "1e-10", windows returns "1e-010"
 
48
--replace_result 1e-010 1e-10
 
49
select @test_int,@test_double,@test_string,@test_string2,@select;
 
50
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
 
51
select @test_int,@test_double,@test_string,@test_string2;
 
52
set @test_int="hellohello",@test_double="hellohello",@test_string="hellohello",@test_string2="hellohello";
 
53
select @test_int,@test_double,@test_string,@test_string2;
 
54
set @test_int=null,@test_double=null,@test_string=null,@test_string2=null;
 
55
select @test_int,@test_double,@test_string,@test_string2;
 
56
select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
 
57
explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
 
58
select @t5;
 
59
 
 
60
#
 
61
# Test problem with WHERE and variables
 
62
#
 
63
 
 
64
CREATE TABLE t1 (c_id INT(4) NOT NULL, c_name CHAR(20), c_country CHAR(3), PRIMARY KEY(c_id));
 
65
INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB');
 
66
SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1;
 
67
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid;
 
68
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid OR c_id=666;
 
69
ALTER TABLE t1 DROP PRIMARY KEY;
 
70
select * from t1 where c_id=@min_cid OR c_id=@max_cid;
 
71
drop table t1;
 
72
 
 
73
#
 
74
# Test system variables
 
75
#
 
76
set GLOBAL max_join_size=10;
 
77
set max_join_size=100;
 
78
show variables like 'max_join_size';
 
79
select * from information_schema.session_variables where variable_name like 'max_join_size';
 
80
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
81
show global variables like 'max_join_size';
 
82
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
83
select * from information_schema.global_variables where variable_name like 'max_join_size';
 
84
set GLOBAL max_join_size=2000;
 
85
show global variables like 'max_join_size';
 
86
select * from information_schema.global_variables where variable_name like 'max_join_size';
 
87
set max_join_size=DEFAULT;
 
88
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
89
show variables like 'max_join_size';
 
90
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
91
select * from information_schema.session_variables where variable_name like 'max_join_size';
 
92
set GLOBAL max_join_size=DEFAULT;
 
93
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
94
show global variables like 'max_join_size';
 
95
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
96
select * from information_schema.global_variables where variable_name like 'max_join_size';
 
97
set @@max_join_size=1000, @@global.max_join_size=2000;
 
98
select @@local.max_join_size, @@global.max_join_size;
 
99
select @@identity,  length(@@version)>0;
 
100
select @@VERSION=version();
 
101
select last_insert_id(345);
 
102
explain extended select last_insert_id(345);
 
103
select @@IDENTITY,last_insert_id(), @@identity;
 
104
explain extended select @@IDENTITY,last_insert_id(), @@identity;
 
105
 
 
106
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
 
107
 
 
108
set global concurrent_insert=2;
 
109
show variables like 'concurrent_insert';
 
110
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
 
111
set global concurrent_insert=1;
 
112
show variables like 'concurrent_insert';
 
113
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
 
114
set global concurrent_insert=0;
 
115
show variables like 'concurrent_insert';
 
116
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
 
117
# no global value set global concurrent_insert=DEFAULT;
 
118
select @@concurrent_insert;
 
119
 
 
120
set global timed_mutexes=ON;
 
121
show variables like 'timed_mutexes';
 
122
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
 
123
set global timed_mutexes=0;
 
124
show variables like 'timed_mutexes';
 
125
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
 
126
 
 
127
set storage_engine=MYISAM, storage_engine="HEAP";
 
128
show local variables like 'storage_engine';
 
129
select * from information_schema.session_variables where variable_name like 'storage_engine';
 
130
show global variables like 'storage_engine';
 
131
select * from information_schema.global_variables where variable_name like 'storage_engine';
 
132
 
 
133
set GLOBAL myisam_max_sort_file_size=2000000;
 
134
show global variables like 'myisam_max_sort_file_size';
 
135
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
 
136
set GLOBAL myisam_max_sort_file_size=default;
 
137
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
 
138
show global variables like 'myisam_max_sort_file_size';
 
139
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
 
140
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
 
141
 
 
142
set global net_retry_count=10, session net_retry_count=10;
 
143
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
 
144
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
 
145
show global variables like 'net_%';
 
146
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
147
show session variables like 'net_%';
 
148
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
149
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
 
150
show global variables like 'net_%';
 
151
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
152
show session variables like 'net_%';
 
153
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
154
set net_buffer_length=1;
 
155
show variables like 'net_buffer_length';
 
156
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
 
157
#warning 1292
 
158
set net_buffer_length=2000000000;
 
159
show variables like 'net_buffer_length';
 
160
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
 
161
 
 
162
set character set cp1251_koi8;
 
163
show variables like "character_set_client";
 
164
select * from information_schema.session_variables where variable_name like 'character_set_client';
 
165
select @@timestamp>0;
 
166
 
 
167
set @@rand_seed1=10000000,@@rand_seed2=1000000;
 
168
select ROUND(RAND(),5);
 
169
 
 
170
show variables like '%alloc%';
 
171
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
 
172
set @@range_alloc_block_size=1024*16;
 
173
set @@query_alloc_block_size=1024*17+2;
 
174
set @@query_prealloc_size=1024*18;
 
175
set @@transaction_alloc_block_size=1024*20-1;
 
176
set @@transaction_prealloc_size=1024*21-1;
 
177
select @@query_alloc_block_size;
 
178
show variables like '%alloc%';
 
179
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
 
180
set @@range_alloc_block_size=default;
 
181
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
 
182
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
 
183
show variables like '%alloc%';
 
184
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
 
185
 
 
186
#
 
187
# Bug #10904 Illegal mix of collations between
 
188
# a system variable and a constant
 
189
#
 
190
SELECT @@version LIKE 'non-existent';
 
191
SELECT @@version_compile_os LIKE 'non-existent';
 
192
 
 
193
# The following should give errors
 
194
 
 
195
--error 1231
 
196
set big_tables=OFFF;
 
197
--error 1231
 
198
set big_tables="OFFF";
 
199
--error 1193
 
200
set unknown_variable=1;
 
201
--error 1232
 
202
set max_join_size="hello";
 
203
--error 1286
 
204
set storage_engine=UNKNOWN_TABLE_TYPE;
 
205
--error 1230
 
206
set GLOBAL storage_engine=DEFAULT;
 
207
--error 1115
 
208
set character_set_client=UNKNOWN_CHARACTER_SET;
 
209
--error 1273
 
210
set collation_connection=UNKNOWN_COLLATION;
 
211
--error 1231
 
212
set character_set_client=NULL;
 
213
--error 1231
 
214
set collation_connection=NULL;
 
215
--error 1228
 
216
set global autocommit=1;
 
217
--error 1238
 
218
select @@global.timestamp;
 
219
--error 1238 
 
220
set @@version='';
 
221
--error 1229
 
222
set @@concurrent_insert=1;
 
223
--error 1228
 
224
set @@global.sql_auto_is_null=1;
 
225
--error 1238
 
226
select @@global.sql_auto_is_null;
 
227
--error 1229
 
228
set myisam_max_sort_file_size=100;
 
229
--error 1231
 
230
set @@SQL_WARNINGS=NULL;
 
231
 
 
232
# Test setting all variables
 
233
 
 
234
set autocommit=1;
 
235
set big_tables=1;
 
236
select @@autocommit, @@big_tables;
 
237
set global binlog_cache_size=100;
 
238
set bulk_insert_buffer_size=100;
 
239
set character set cp1251_koi8;
 
240
set character set default;
 
241
set @@global.concurrent_insert=1;
 
242
set global connect_timeout=100;
 
243
select @@delay_key_write;
 
244
set global delay_key_write="OFF";
 
245
select @@delay_key_write;
 
246
set global delay_key_write=ALL;
 
247
select @@delay_key_write;
 
248
set global delay_key_write=1;
 
249
select @@delay_key_write;
 
250
set global flush=1;
 
251
set global flush_time=100;
 
252
set insert_id=1;
 
253
set interactive_timeout=100;
 
254
set join_buffer_size=100;
 
255
set last_insert_id=1;
 
256
set global local_infile=1;
 
257
set long_query_time=0.000001;
 
258
select @@long_query_time;
 
259
set long_query_time=100.000001;
 
260
select @@long_query_time;
 
261
set low_priority_updates=1;
 
262
set max_allowed_packet=100;
 
263
set global max_binlog_cache_size=100;
 
264
set global max_binlog_size=100;
 
265
set global max_connect_errors=100;
 
266
set global max_connections=100;
 
267
set max_heap_table_size=100;
 
268
set max_join_size=100;
 
269
set max_sort_length=100;
 
270
set max_tmp_tables=100;
 
271
set global max_user_connections=100;
 
272
select @@max_user_connections;
 
273
set global max_write_lock_count=100;
 
274
set myisam_sort_buffer_size=100;
 
275
set net_buffer_length=100;
 
276
set net_read_timeout=100;
 
277
set net_write_timeout=100;
 
278
set read_buffer_size=100;
 
279
set read_rnd_buffer_size=100;
 
280
set global rpl_recovery_rank=100;
 
281
set global server_id=100;
 
282
set global slow_launch_time=100;
 
283
set sort_buffer_size=100;
 
284
set @@max_sp_recursion_depth=10;
 
285
select @@max_sp_recursion_depth;
 
286
set @@max_sp_recursion_depth=0;
 
287
select @@max_sp_recursion_depth;
 
288
set sql_auto_is_null=1;
 
289
select @@sql_auto_is_null;
 
290
set @@sql_auto_is_null=0;
 
291
select @@sql_auto_is_null;
 
292
set sql_big_selects=1;
 
293
set sql_big_tables=1;
 
294
set sql_buffer_result=1;
 
295
set sql_log_bin=1;
 
296
set sql_log_off=1;
 
297
set sql_log_update=1;
 
298
set sql_low_priority_updates=1;
 
299
set sql_max_join_size=200;
 
300
select @@sql_max_join_size,@@max_join_size;
 
301
set sql_quote_show_create=1;
 
302
set sql_safe_updates=1;
 
303
set sql_select_limit=1;
 
304
# reset it, so later tests don't get confused
 
305
set sql_select_limit=default;
 
306
set sql_warnings=1;
 
307
set global table_open_cache=100;
 
308
set storage_engine=myisam;
 
309
set global thread_cache_size=100;
 
310
set timestamp=1, timestamp=default;
 
311
set tmp_table_size=100;
 
312
set tx_isolation="READ-COMMITTED";
 
313
set wait_timeout=100;
 
314
set log_warnings=1;
 
315
set global log_warnings=1;
 
316
 
 
317
#
 
318
# Bugs: #20392: INSERT_ID session variable has weird value
 
319
#
 
320
select @@session.insert_id;
 
321
set @save_insert_id=@@session.insert_id;
 
322
set session insert_id=20;
 
323
select @@session.insert_id;
 
324
 
 
325
set session last_insert_id=100;
 
326
select @@session.insert_id;
 
327
select @@session.last_insert_id;
 
328
select @@session.insert_id;
 
329
 
 
330
set @@session.insert_id=@save_insert_id;
 
331
select @@session.insert_id;
 
332
 
 
333
#
 
334
# key buffer
 
335
#
 
336
 
 
337
create table t1 (a int not null auto_increment, primary key(a));
 
338
create table t2 (a int not null auto_increment, primary key(a));
 
339
insert into t1 values(null),(null),(null);
 
340
insert into t2 values(null),(null),(null);
 
341
set global key_buffer_size=100000;
 
342
select @@key_buffer_size;
 
343
select * from t1 where a=2;
 
344
select * from t2 where a=3;
 
345
check table t1,t2;
 
346
select max(a) +1, max(a) +2 into @xx,@yy from t1;
 
347
drop table t1,t2;
 
348
 
 
349
#
 
350
# error conditions
 
351
#
 
352
 
 
353
--error 1193
 
354
select @@xxxxxxxxxx;
 
355
select 1;
 
356
 
 
357
--error 1238
 
358
select @@session.key_buffer_size;
 
359
 
 
360
--error 1229
 
361
set ft_boolean_syntax = @@init_connect;
 
362
--error 1231
 
363
set global ft_boolean_syntax = @@init_connect;
 
364
--error 1229
 
365
set init_connect = NULL;
 
366
set global init_connect = NULL;
 
367
--error 1229
 
368
set ft_boolean_syntax = @@init_connect;
 
369
--error 1231
 
370
set global ft_boolean_syntax = @@init_connect;
 
371
 
 
372
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
 
373
# expected: check that there is no overflow when 64-bit unsigned
 
374
# variables are set
 
375
 
 
376
set global myisam_max_sort_file_size=4294967296;
 
377
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
 
378
show global variables like 'myisam_max_sort_file_size';
 
379
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
 
380
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
 
381
set global myisam_max_sort_file_size=default;
 
382
 
 
383
#
 
384
# swap
 
385
#
 
386
select @@global.max_user_connections,@@local.max_join_size;
 
387
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
 
388
select @@global.max_user_connections,@@local.max_join_size;
 
389
set @@global.max_user_connections=111,@@local.max_join_size=222;
 
390
select @@global.max_user_connections,@@local.max_join_size;
 
391
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
 
392
select @@global.max_user_connections,@@local.max_join_size;
 
393
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
 
394
select @@global.max_user_connections,@@local.max_join_size;
 
395
set @a=1, @b=2;
 
396
set @a=@b, @b=@a;
 
397
select @a, @b;
 
398
 
 
399
#
 
400
# Bug#2586:Disallow global/session/local as structured var. instance names
 
401
#
 
402
--error 1064
 
403
set @@global.global.key_buffer_size= 1;
 
404
--error 1064
 
405
set GLOBAL global.key_buffer_size= 1;
 
406
--error 1064
 
407
SELECT @@global.global.key_buffer_size;
 
408
--error 1064
 
409
SELECT @@global.session.key_buffer_size;
 
410
--error 1064
 
411
SELECT @@global.local.key_buffer_size;
 
412
 
 
413
# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)
 
414
set @tstlw = @@log_warnings;
 
415
show global variables like 'log_warnings';
 
416
select * from information_schema.global_variables where variable_name like 'log_warnings';
 
417
set global log_warnings = 0;
 
418
show global variables like 'log_warnings';
 
419
select * from information_schema.global_variables where variable_name like 'log_warnings';
 
420
set global log_warnings = 42;
 
421
show global variables like 'log_warnings';
 
422
select * from information_schema.global_variables where variable_name like 'log_warnings';
 
423
set global log_warnings = @tstlw;
 
424
show global variables like 'log_warnings';
 
425
select * from information_schema.global_variables where variable_name like 'log_warnings';
 
426
 
 
427
#
 
428
# BUG#4788 show create table provides incorrect statement
 
429
#
 
430
# What default width have numeric types?
 
431
create table t1 (
 
432
  c1 tinyint,
 
433
  c2 smallint,
 
434
  c3 mediumint,
 
435
  c4 int,
 
436
  c5 bigint);
 
437
show create table t1;
 
438
drop table t1;
 
439
#
 
440
# What types and widths have variables?
 
441
set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0;
 
442
create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
 
443
show create table t1;
 
444
drop table t1;
 
445
 
 
446
 
 
447
#
 
448
# Bug #6993: myisam_data_pointer_size
 
449
# Wrong bug report, data pointer size must be restricted to 7,
 
450
# setting to 8 will not work on all computers, myisamchk and
 
451
# the server may see a wrong value, such as 0 or negative number
 
452
# if 8 bytes is set.
 
453
#
 
454
 
 
455
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
 
456
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
 
457
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYISAM_DATA_POINTER_SIZE';
 
458
 
 
459
#
 
460
# Bug #6958: negative arguments to integer options wrap around
 
461
#
 
462
 
 
463
SET GLOBAL table_open_cache=-1;
 
464
SHOW VARIABLES LIKE 'table_open_cache';
 
465
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
 
466
SET GLOBAL table_open_cache=DEFAULT;
 
467
 
 
468
#
 
469
# Bugs12363: character_set_results is nullable,
 
470
# but value_ptr returns string "NULL"
 
471
#
 
472
set character_set_results=NULL;
 
473
select ifnull(@@character_set_results,"really null");
 
474
set names latin1;
 
475
 
 
476
 
 
477
#
 
478
# Bug #9613: @@have_innodb
 
479
#
 
480
 
 
481
--replace_column 1 #
 
482
select @@have_innodb;
 
483
 
 
484
#
 
485
# Tests for lc_time_names
 
486
# Note, when adding new locales, please fix ID accordingly:
 
487
# - to test the last ID (currently 108)
 
488
# - and the next after the last (currently 109)
 
489
#
 
490
--echo *** Various tests with LC_TIME_NAMES
 
491
--echo *** LC_TIME_NAMES: testing case insensitivity
 
492
set @@lc_time_names='ru_ru';
 
493
select @@lc_time_names;
 
494
--echo *** LC_TIME_NAMES: testing with a user variable
 
495
set @lc='JA_JP';
 
496
set @@lc_time_names=@lc;
 
497
select @@lc_time_names;
 
498
--echo *** LC_TIME_NAMES: testing with string expressions
 
499
set lc_time_names=concat('de','_','DE');
 
500
select @@lc_time_names;
 
501
--error 1105
 
502
set lc_time_names=concat('de','+','DE');
 
503
select @@lc_time_names;
 
504
--echo LC_TIME_NAMES: testing with numeric expressions
 
505
set @@lc_time_names=1+2;
 
506
select @@lc_time_names;
 
507
--error 1232
 
508
set @@lc_time_names=1/0;
 
509
select @@lc_time_names;
 
510
set lc_time_names=en_US;
 
511
--echo LC_TIME_NAMES: testing NULL and a negative number:
 
512
--error 1231
 
513
set lc_time_names=NULL;
 
514
--error 1105
 
515
set lc_time_names=-1;
 
516
select @@lc_time_names;
 
517
--echo LC_TIME_NAMES: testing locale with the last ID:
 
518
set lc_time_names=108;
 
519
select @@lc_time_names;
 
520
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
 
521
--error 1105
 
522
set lc_time_names=109;
 
523
select @@lc_time_names;
 
524
--echo LC_TIME_NAMES: testing that 0 is en_US:
 
525
set lc_time_names=0;
 
526
select @@lc_time_names;
 
527
 
 
528
#
 
529
# Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect
 
530
#
 
531
select @@global.lc_time_names, @@lc_time_names;
 
532
set @@global.lc_time_names=fr_FR;
 
533
select @@global.lc_time_names, @@lc_time_names;
 
534
--echo New connection
 
535
connect (con1,localhost,root,,);
 
536
connection con1;
 
537
select @@global.lc_time_names, @@lc_time_names;
 
538
set @@lc_time_names=ru_RU;
 
539
select @@global.lc_time_names, @@lc_time_names;
 
540
disconnect con1;
 
541
connection default;
 
542
--echo Returnung to default connection
 
543
select @@global.lc_time_names, @@lc_time_names;
 
544
set lc_time_names=default;
 
545
select @@global.lc_time_names, @@lc_time_names;
 
546
set @@global.lc_time_names=default;
 
547
select @@global.lc_time_names, @@lc_time_names;
 
548
set @@lc_time_names=default;
 
549
select @@global.lc_time_names, @@lc_time_names;
 
550
 
 
551
 
 
552
#
 
553
# Bug #13334: query_prealloc_size default less than minimum
 
554
#
 
555
set @test = @@query_prealloc_size;
 
556
set @@query_prealloc_size = @test;
 
557
select @@query_prealloc_size = @test;
 
558
 
 
559
--echo End of 4.1 tests
 
560
 
 
561
#
 
562
# Bug#6282 Packet error with SELECT INTO
 
563
 
564
 
 
565
create table t1 (a int);
 
566
select a into @x from t1;
 
567
show warnings;
 
568
drop table t1;
 
569
 
 
570
#
 
571
# Bug #10339: read only variables.
 
572
#
 
573
 
 
574
--error 1238
 
575
set @@warning_count=1;
 
576
--error 1238
 
577
set @@global.error_count=1;
 
578
 
 
579
#
 
580
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
 
581
#
 
582
 
 
583
set @@max_heap_table_size= 4294967296;
 
584
select @@max_heap_table_size > 0;
 
585
set global max_heap_table_size= 4294967296;
 
586
select @@max_heap_table_size > 0;
 
587
set @@max_heap_table_size= 4294967296;
 
588
select @@max_heap_table_size > 0;
 
589
 
 
590
#
 
591
# Bug #11775 Variable character_set_system does not exist (sometimes)
 
592
#
 
593
select @@character_set_system;
 
594
--error 1238
 
595
set global character_set_system = latin1;
 
596
--error 1238
 
597
set @@global.version_compile_os='234';
 
598
 
 
599
#
 
600
# Check character_set_filesystem variable
 
601
#
 
602
set character_set_filesystem=latin1;
 
603
select @@character_set_filesystem;
 
604
set @@global.character_set_filesystem=latin2;
 
605
set character_set_filesystem=latin1;
 
606
select @@character_set_filesystem;
 
607
set @@global.character_set_filesystem=latin2;
 
608
set character_set_filesystem=default;
 
609
select @@character_set_filesystem;
 
610
set @@global.character_set_filesystem=default;
 
611
select @@global.character_set_filesystem;
 
612
 
 
613
#
 
614
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
 
615
#
 
616
set @old_sql_big_selects = @@sql_big_selects;
 
617
set @@sql_big_selects = 1;
 
618
show variables like 'sql_big_selects';
 
619
select * from information_schema.session_variables where variable_name like 'sql_big_selects';
 
620
set @@sql_big_selects = @old_sql_big_selects;
 
621
 
 
622
#
 
623
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
 
624
# sql_notes values
 
625
 
626
set @@sql_notes = 0, @@sql_warnings = 0;
 
627
show variables like 'sql_notes';
 
628
select * from information_schema.session_variables where variable_name like 'sql_notes';
 
629
show variables like 'sql_warnings';
 
630
select * from information_schema.session_variables where variable_name like 'sql_warnings';
 
631
set @@sql_notes = 1, @@sql_warnings = 1;
 
632
show variables like 'sql_notes';
 
633
select * from information_schema.session_variables where variable_name like 'sql_notes';
 
634
show variables like 'sql_warnings';
 
635
select * from information_schema.session_variables where variable_name like 'sql_warnings';
 
636
 
 
637
#
 
638
# Bug #12792: @@system_time_zone is not SELECTable.
 
639
#
 
640
# Don't actually output, since it depends on the system
 
641
--replace_column 1 #
 
642
select @@system_time_zone;
 
643
 
 
644
#
 
645
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
 
646
#
 
647
# Don't actually output, since it depends on the system
 
648
--replace_column 1 # 2 # 3 # 4 #
 
649
select @@version, @@version_comment, @@version_compile_machine,
 
650
       @@version_compile_os;
 
651
 
 
652
#
 
653
# Bug #1039: make tmpdir and datadir available as @@variables (also included
 
654
# basedir)
 
655
#
 
656
# Don't actually output, since it depends on the system
 
657
--replace_column 1 # 2 # 3 #
 
658
select @@basedir, @@datadir, @@tmpdir;
 
659
--replace_column 2 #
 
660
show variables like 'basedir';
 
661
--replace_column 2 #
 
662
select * from information_schema.session_variables where variable_name like 'basedir';
 
663
--replace_column 2 #
 
664
show variables like 'datadir';
 
665
--replace_column 2 #
 
666
select * from information_schema.session_variables where variable_name like 'datadir';
 
667
--replace_column 2 #
 
668
show variables like 'tmpdir';
 
669
--replace_column 2 #
 
670
select * from information_schema.session_variables where variable_name like 'tmpdir';
 
671
 
 
672
#
 
673
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
 
674
 
675
# Don't actually output, since it depends on the system
 
676
--replace_column 1 # 2 # 3 # 4 # 5 #
 
677
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
 
678
--replace_column 2 #
 
679
show variables like 'ssl%';
 
680
--replace_column 2 #
 
681
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
 
682
 
 
683
#
 
684
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
 
685
# and as @@log_queries_not_using_indexes
 
686
#
 
687
select @@log_queries_not_using_indexes;
 
688
show variables like 'log_queries_not_using_indexes';
 
689
select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
 
690
 
 
691
#
 
692
# Bug#20908: Crash if select @@""
 
693
#
 
694
--error ER_PARSE_ERROR
 
695
select @@"";
 
696
--error ER_PARSE_ERROR
 
697
select @@&;
 
698
--error ER_PARSE_ERROR
 
699
select @@@;
 
700
 
 
701
#
 
702
# Bug#20166 mysql-test-run.pl does not test system privilege tables creation
 
703
#
 
704
# Don't actually output, since it depends on the system
 
705
--replace_column 1 #
 
706
select @@hostname;
 
707
--error 1238
 
708
set @@hostname= "anothername";
 
709
--replace_column 2 #
 
710
show variables like 'hostname';
 
711
 
 
712
--echo End of 5.0 tests
 
713
 
 
714
# This is at the very after the versioned tests, since it involves doing
 
715
# cleanup
 
716
#
 
717
# Bug #19263: variables.test doesn't clean up after itself (II/II --
 
718
# restore)
 
719
#
 
720
set global binlog_cache_size         =@my_binlog_cache_size;
 
721
set global connect_timeout           =@my_connect_timeout;
 
722
set global flush                     =@my_flush;
 
723
set global flush_time                =@my_flush_time;
 
724
set global key_buffer_size           =@my_key_buffer_size;
 
725
set global max_binlog_cache_size     =default;                #@my_max_binlog_cache_size;
 
726
set global max_binlog_size           =@my_max_binlog_size;
 
727
set global max_connect_errors        =@my_max_connect_errors;
 
728
set global max_connections           =@my_max_connections;
 
729
set global max_heap_table_size       =@my_max_heap_table_size;
 
730
set global max_join_size             =@my_max_join_size;
 
731
# No default
 
732
#set global max_user_connections      =default;
 
733
set global max_write_lock_count      =default;
 
734
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
 
735
set global net_buffer_length         =@my_net_buffer_length;
 
736
set global net_write_timeout         =@my_net_write_timeout;
 
737
set global net_read_timeout          =@my_net_read_timeout;
 
738
set global rpl_recovery_rank         =@my_rpl_recovery_rank;
 
739
set global server_id                 =@my_server_id;
 
740
set global slow_launch_time          =@my_slow_launch_time;
 
741
set global storage_engine            =@my_storage_engine;
 
742
set global thread_cache_size         =@my_thread_cache_size;
 
743
 
 
744
#
 
745
# Bug#28580 Repeatation of status variables
 
746
#
 
747
--replace_column 2 #
 
748
show global variables where Variable_name='table_definition_cache' or
 
749
Variable_name='table_lock_wait_timeout';
 
750
 
 
751
###########################################################################
 
752
 
 
753
--echo
 
754
--echo # --
 
755
--echo # -- Bug#34820: log_output can be set to illegal value.
 
756
--echo # --
 
757
 
 
758
--error ER_WRONG_VALUE_FOR_VAR
 
759
SET GLOBAL log_output = '';
 
760
 
 
761
--error ER_WRONG_VALUE_FOR_VAR
 
762
SET GLOBAL log_output = 0;
 
763
 
 
764
--echo
 
765
--echo # -- End of Bug#34820.
 
766