9
9
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
11
set @my_binlog_cache_size =@@global.binlog_cache_size;
12
11
set @my_connect_timeout =@@global.connect_timeout;
13
12
set @my_flush =@@global.flush;
14
set @my_flush_time =@@global.flush_time;
15
13
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
14
set @my_max_connect_errors =@@global.max_connect_errors;
19
15
set @my_max_connections =@@global.max_connections;
20
16
set @my_max_heap_table_size =@@global.max_heap_table_size;
21
17
set @my_max_join_size =@@global.max_join_size;
22
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
23
18
set @my_net_buffer_length =@@global.net_buffer_length;
24
19
set @my_net_write_timeout =@@global.net_write_timeout;
25
20
set @my_net_read_timeout =@@global.net_read_timeout;
26
set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
27
21
set @my_server_id =@@global.server_id;
28
22
set @my_slow_launch_time =@@global.slow_launch_time;
29
23
set @my_storage_engine =@@global.storage_engine;
30
set @my_thread_cache_size =@@global.thread_cache_size;
32
25
# case insensitivity tests (new in 5.0)
61
54
# Test problem with WHERE and variables
64
CREATE TABLE t1 (c_id INT(4) NOT NULL, c_name CHAR(20), c_country CHAR(3), PRIMARY KEY(c_id));
57
CREATE TABLE t1 (c_id INT NOT NULL, c_name VARCHAR(250), c_country VARCHAR(250), PRIMARY KEY(c_id));
65
58
INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB');
66
59
SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1;
67
60
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid;
103
96
select @@IDENTITY,last_insert_id(), @@identity;
104
97
explain extended select @@IDENTITY,last_insert_id(), @@identity;
106
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
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;
120
99
set global timed_mutexes=ON;
121
100
show variables like 'timed_mutexes';
122
101
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
159
138
show variables like 'net_buffer_length';
160
139
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
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;
167
set @@rand_seed1=10000000,@@rand_seed2=1000000;
168
select ROUND(RAND(),5);
170
141
show variables like '%alloc%';
171
142
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
172
143
set @@range_alloc_block_size=1024*16;
232
185
# Test setting all variables
234
187
set autocommit=1;
236
select @@autocommit, @@big_tables;
237
set global binlog_cache_size=100;
238
189
set bulk_insert_buffer_size=100;
239
set character set cp1251_koi8;
240
set character set default;
241
set @@global.concurrent_insert=1;
242
190
set global connect_timeout=100;
243
191
select @@delay_key_write;
244
192
set global delay_key_write="OFF";
245
193
select @@delay_key_write;
246
194
set global delay_key_write=ALL;
247
select @@delay_key_write;
248
195
set global delay_key_write=1;
249
196
select @@delay_key_write;
251
set global flush_time=100;
253
197
set interactive_timeout=100;
254
198
set join_buffer_size=100;
255
199
set last_insert_id=1;
256
200
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
201
set max_allowed_packet=100;
263
set global max_binlog_cache_size=100;
264
set global max_binlog_size=100;
265
202
set global max_connect_errors=100;
266
203
set global max_connections=100;
267
204
set max_heap_table_size=100;
268
205
set max_join_size=100;
269
206
set max_sort_length=100;
270
207
set max_tmp_tables=100;
271
set global max_user_connections=100;
272
select @@max_user_connections;
273
208
set global max_write_lock_count=100;
274
set myisam_sort_buffer_size=100;
209
set global myisam_sort_buffer_size=100;
275
210
set net_buffer_length=100;
276
211
set net_read_timeout=100;
277
212
set net_write_timeout=100;
278
213
set read_buffer_size=100;
279
214
set read_rnd_buffer_size=100;
280
set global rpl_recovery_rank=100;
281
215
set global server_id=100;
282
216
set global slow_launch_time=100;
283
217
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
218
set sql_big_selects=1;
293
set sql_big_tables=1;
294
219
set sql_buffer_result=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
220
set sql_safe_updates=1;
303
221
set sql_select_limit=1;
304
222
# reset it, so later tests don't get confused
306
224
set sql_warnings=1;
307
225
set global table_open_cache=100;
308
226
set storage_engine=myisam;
309
set global thread_cache_size=100;
310
227
set timestamp=1, timestamp=default;
311
228
set tmp_table_size=100;
312
229
set tx_isolation="READ-COMMITTED";
313
230
set wait_timeout=100;
315
set global log_warnings=1;
318
# Bugs: #20392: INSERT_ID session variable has weird value
320
select @@session.insert_id;
321
set @save_insert_id=@@session.insert_id;
322
set session insert_id=20;
323
select @@session.insert_id;
325
set session last_insert_id=100;
326
select @@session.insert_id;
327
select @@session.last_insert_id;
328
select @@session.insert_id;
330
set @@session.insert_id=@save_insert_id;
331
select @@session.insert_id;
372
271
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
373
272
set global myisam_max_sort_file_size=default;
378
select @@global.max_user_connections,@@local.max_join_size;
379
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
380
select @@global.max_user_connections,@@local.max_join_size;
381
set @@global.max_user_connections=111,@@local.max_join_size=222;
382
select @@global.max_user_connections,@@local.max_join_size;
383
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
384
select @@global.max_user_connections,@@local.max_join_size;
385
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
386
select @@global.max_user_connections,@@local.max_join_size;
277
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
278
#set @svc=@@global.myisam_max_sort_file_size, @svj=@@local.max_join_size;
279
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
280
#set @@global.myisam_max_sort_file_size=111,@@local.max_join_size=222;
281
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
282
#set @@global.myisam_max_sort_file_size=@@local.max_join_size,@@local.max_join_size=@@global.myisam_max_sort_file_size;
283
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
284
#set @@global.myisam_max_sort_file_size=@svc, @@local.max_join_size=@svj;
285
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
392
291
# Bug#2586:Disallow global/session/local as structured var. instance names
403
302
SELECT @@global.local.key_buffer_size;
405
# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)
406
set @tstlw = @@log_warnings;
407
show global variables like 'log_warnings';
408
select * from information_schema.global_variables where variable_name like 'log_warnings';
409
set global log_warnings = 0;
410
show global variables like 'log_warnings';
411
select * from information_schema.global_variables where variable_name like 'log_warnings';
412
set global log_warnings = 42;
413
show global variables like 'log_warnings';
414
select * from information_schema.global_variables where variable_name like 'log_warnings';
415
set global log_warnings = @tstlw;
416
show global variables like 'log_warnings';
417
select * from information_schema.global_variables where variable_name like 'log_warnings';
420
305
# BUG#4788 show create table provides incorrect statement
422
307
# What default width have numeric types?
423
308
create table t1 (
429
314
show create table t1;
435
320
show create table t1;
440
# Bug #6993: myisam_data_pointer_size
441
# Wrong bug report, data pointer size must be restricted to 7,
442
# setting to 8 will not work on all computers, myisamchk and
443
# the server may see a wrong value, such as 0 or negative number
447
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
448
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
449
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYISAM_DATA_POINTER_SIZE';
452
324
# Bug #6958: negative arguments to integer options wrap around
455
327
SET GLOBAL table_open_cache=-1;
456
328
SHOW VARIABLES LIKE 'table_open_cache';
457
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
329
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
330
#SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
458
331
SET GLOBAL table_open_cache=DEFAULT;
461
# Bugs12363: character_set_results is nullable,
462
# but value_ptr returns string "NULL"
464
set character_set_results=NULL;
465
select ifnull(@@character_set_results,"really null");
470
# Bug #9613: @@have_innodb
474
select @@have_innodb;
477
334
# Tests for lc_time_names
478
335
# Note, when adding new locales, please fix ID accordingly:
479
336
# - to test the last ID (currently 108)
583
440
# Bug #11775 Variable character_set_system does not exist (sometimes)
585
443
select @@character_set_system;
587
set global character_set_system = latin1;
445
set global character_set_system = utf8;
589
447
set @@global.version_compile_os='234';
592
# Check character_set_filesystem variable
450
# Check character_set_filesystem variable invalid for Drizzle
594
set character_set_filesystem=latin1;
595
select @@character_set_filesystem;
596
set @@global.character_set_filesystem=latin2;
597
set character_set_filesystem=latin1;
598
select @@character_set_filesystem;
599
set @@global.character_set_filesystem=latin2;
600
set character_set_filesystem=default;
601
select @@character_set_filesystem;
602
set @@global.character_set_filesystem=default;
603
select @@global.character_set_filesystem;
453
set @@global.character_set_filesystem=utf8;
455
set character_set_filesystem=utf8;
606
458
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
618
471
set @@sql_notes = 0, @@sql_warnings = 0;
619
472
show variables like 'sql_notes';
620
select * from information_schema.session_variables where variable_name like 'sql_notes';
473
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
474
#select * from information_schema.session_variables where variable_name like 'sql_notes';
621
475
show variables like 'sql_warnings';
622
select * from information_schema.session_variables where variable_name like 'sql_warnings';
476
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
477
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
623
478
set @@sql_notes = 1, @@sql_warnings = 1;
624
479
show variables like 'sql_notes';
625
select * from information_schema.session_variables where variable_name like 'sql_notes';
480
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
481
#select * from information_schema.session_variables where variable_name like 'sql_notes';
626
482
show variables like 'sql_warnings';
627
select * from information_schema.session_variables where variable_name like 'sql_warnings';
483
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
484
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
630
487
# Bug #12792: @@system_time_zone is not SELECTable.
651
508
--replace_column 2 #
652
509
show variables like 'basedir';
653
510
--replace_column 2 #
654
select * from information_schema.session_variables where variable_name like 'basedir';
511
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
512
#select * from information_schema.session_variables where variable_name like 'basedir';
655
513
--replace_column 2 #
656
514
show variables like 'datadir';
657
515
--replace_column 2 #
658
select * from information_schema.session_variables where variable_name like 'datadir';
516
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
517
#select * from information_schema.session_variables where variable_name like 'datadir';
659
518
--replace_column 2 #
660
519
show variables like 'tmpdir';
661
520
--replace_column 2 #
662
select * from information_schema.session_variables where variable_name like 'tmpdir';
521
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
522
#select * from information_schema.session_variables where variable_name like 'tmpdir';
665
525
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
667
527
# Don't actually output, since it depends on the system
668
--replace_column 1 # 2 # 3 # 4 # 5 #
669
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
671
show variables like 'ssl%';
673
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
528
#--replace_column 1 # 2 # 3 # 4 # 5 #
529
# Not supported in Drizzle
530
#select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
531
#--replace_column 2 #
532
#show variables like 'ssl%';
533
#--replace_column 2 #
534
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
535
#select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
676
538
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
677
539
# and as @@log_queries_not_using_indexes
679
select @@log_queries_not_using_indexes;
680
show variables like 'log_queries_not_using_indexes';
681
select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
541
# Not valid in Drizzle
542
#select @@log_queries_not_using_indexes;
543
#show variables like 'log_queries_not_using_indexes';
544
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
545
#select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
684
548
# Bug#20908: Crash if select @@""
709
573
# Bug #19263: variables.test doesn't clean up after itself (II/II --
712
set global binlog_cache_size =@my_binlog_cache_size;
713
576
set global connect_timeout =@my_connect_timeout;
714
577
set global flush =@my_flush;
715
579
set global flush_time =@my_flush_time;
716
580
set global key_buffer_size =@my_key_buffer_size;
717
set global max_binlog_cache_size =default; #@my_max_binlog_cache_size;
718
set global max_binlog_size =@my_max_binlog_size;
719
581
set global max_connect_errors =@my_max_connect_errors;
720
582
set global max_connections =@my_max_connections;
721
583
set global max_heap_table_size =@my_max_heap_table_size;
724
586
#set global max_user_connections =default;
725
587
set global max_write_lock_count =default;
726
589
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
727
590
set global net_buffer_length =@my_net_buffer_length;
728
591
set global net_write_timeout =@my_net_write_timeout;
729
592
set global net_read_timeout =@my_net_read_timeout;
730
set global rpl_recovery_rank =@my_rpl_recovery_rank;
731
593
set global server_id =@my_server_id;
732
594
set global slow_launch_time =@my_slow_launch_time;
733
595
set global storage_engine =@my_storage_engine;
734
597
set global thread_cache_size =@my_thread_cache_size;
737
600
# Bug#28580 Repeatation of status variables
739
602
--replace_column 2 #
740
show global variables where Variable_name='table_definition_cache' or
741
Variable_name='table_lock_wait_timeout';
743
###########################################################################
747
--echo # -- Bug#34820: log_output can be set to illegal value.
750
--error ER_WRONG_VALUE_FOR_VAR
751
SET GLOBAL log_output = '';
753
--error ER_WRONG_VALUE_FOR_VAR
754
SET GLOBAL log_output = 0;
757
--echo # -- End of Bug#34820.
604
#show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';