9
9
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
11
set @my_connect_timeout =@@global.connect_timeout;
12
set @my_flush =@@global.flush;
13
set @my_key_buffer_size =@@global.key_buffer_size;
14
set @my_max_connect_errors =@@global.max_connect_errors;
11
15
set @my_max_heap_table_size =@@global.max_heap_table_size;
12
16
set @my_max_join_size =@@global.max_join_size;
13
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
17
set @my_net_buffer_length =@@global.net_buffer_length;
18
set @my_net_write_timeout =@@global.net_write_timeout;
19
set @my_net_read_timeout =@@global.net_read_timeout;
14
20
set @my_server_id =@@global.server_id;
21
set @my_slow_launch_time =@@global.slow_launch_time;
15
22
set @my_storage_engine =@@global.storage_engine;
16
set @my_myisam_sort_buffer_size =@@global.myisam_sort_buffer_size;
17
set @my_tx_isolation =@@global.tx_isolation;
19
24
# case insensitivity tests (new in 5.0)
63
68
set GLOBAL max_join_size=10;
64
69
set max_join_size=100;
65
70
show variables like 'max_join_size';
66
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
71
select * from information_schema.session_variables where variable_name like 'max_join_size';
67
72
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
68
73
show global variables like 'max_join_size';
69
74
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
70
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
75
select * from information_schema.global_variables where variable_name like 'max_join_size';
71
76
set GLOBAL max_join_size=2000;
72
77
show global variables like 'max_join_size';
73
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
78
select * from information_schema.global_variables where variable_name like 'max_join_size';
74
79
set max_join_size=DEFAULT;
75
80
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
76
81
show variables like 'max_join_size';
77
82
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
78
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
83
select * from information_schema.session_variables where variable_name like 'max_join_size';
79
84
set GLOBAL max_join_size=DEFAULT;
80
85
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
81
86
show global variables like 'max_join_size';
82
87
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
83
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
88
select * from information_schema.global_variables where variable_name like 'max_join_size';
84
89
set @@max_join_size=1000, @@global.max_join_size=2000;
85
90
select @@local.max_join_size, @@global.max_join_size;
86
91
select @@identity, length(@@version)>0;
93
98
set global timed_mutexes=ON;
94
99
show variables like 'timed_mutexes';
95
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
100
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
96
101
set global timed_mutexes=0;
97
102
show variables like 'timed_mutexes';
98
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
103
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
100
set storage_engine=MYISAM, storage_engine="MEMORY";
105
set storage_engine=MYISAM, storage_engine="HEAP";
101
106
show local variables like 'storage_engine';
102
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
107
select * from information_schema.session_variables where variable_name like 'storage_engine';
103
108
show global variables like 'storage_engine';
104
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
109
select * from information_schema.global_variables where variable_name like 'storage_engine';
106
111
set GLOBAL myisam_max_sort_file_size=2000000;
107
112
show global variables like 'myisam_max_sort_file_size';
108
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
113
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
109
114
set GLOBAL myisam_max_sort_file_size=default;
110
115
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
111
116
show global variables like 'myisam_max_sort_file_size';
112
117
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
113
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
118
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
115
set global mysql_protocol_buffer_length=1024;
116
show global variables like 'mysql_protocol_buffer_%';
117
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
118
show global variables like 'mysql_protocol_buffer_%';
119
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
120
set global mysql_protocol_buffer_length=1;
121
show variables like 'mysql_protocol_buffer_length';
120
set global net_retry_count=10, session net_retry_count=10;
121
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
122
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
123
show global variables like 'net_%';
124
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
125
show session variables like 'net_%';
126
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
127
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
128
show global variables like 'net_%';
129
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
130
show session variables like 'net_%';
131
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
132
set net_buffer_length=1;
133
show variables like 'net_buffer_length';
134
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
123
set global mysql_protocol_buffer_length=2000000000;
124
show variables like 'mysql_protocol_buffer_length';
136
set net_buffer_length=2000000000;
137
show variables like 'net_buffer_length';
138
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
126
140
show variables like '%alloc%';
127
select * from data_dictionary.session_variables where variable_name like '%alloc%';
141
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
128
142
set @@range_alloc_block_size=1024*16;
129
143
set @@query_alloc_block_size=1024*17+2;
130
144
set @@query_prealloc_size=1024*18;
145
set @@transaction_alloc_block_size=1024*20-1;
146
set @@transaction_prealloc_size=1024*21-1;
131
147
select @@query_alloc_block_size;
132
148
show variables like '%alloc%';
133
select * from data_dictionary.session_variables where variable_name like '%alloc%';
149
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
134
150
set @@range_alloc_block_size=default;
135
151
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
152
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
136
153
show variables like '%alloc%';
137
select * from data_dictionary.session_variables where variable_name like '%alloc%';
154
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
140
157
# Bug #10904 Illegal mix of collations between
146
163
# The following should give errors
148
--error ER_UNKNOWN_SYSTEM_VARIABLE
149
166
set unknown_variable=1;
150
--error ER_WRONG_TYPE_FOR_VAR
151
168
set max_join_size="hello";
152
--error ER_UNKNOWN_STORAGE_ENGINE
153
170
set storage_engine=UNKNOWN_TABLE_TYPE;
154
--error ER_NO_DEFAULT
155
172
set GLOBAL storage_engine=DEFAULT;
156
--error ER_LOCAL_VARIABLE
157
174
set global autocommit=1;
158
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
159
176
select @@global.timestamp;
160
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
161
178
set @@version='';
162
--error ER_GLOBAL_VARIABLE
163
180
set myisam_max_sort_file_size=100;
164
--error ER_WRONG_VALUE_FOR_VAR
165
182
set @@SQL_WARNINGS=NULL;
167
184
# Test setting all variables
169
186
set autocommit=1;
170
187
select @@autocommit;
171
188
set bulk_insert_buffer_size=100;
189
set global connect_timeout=100;
190
select @@delay_key_write;
191
set global delay_key_write="OFF";
192
select @@delay_key_write;
193
set global delay_key_write=ALL;
194
set global delay_key_write=1;
195
select @@delay_key_write;
196
set interactive_timeout=100;
172
197
set join_buffer_size=100;
173
198
set last_insert_id=1;
199
set global local_infile=1;
174
200
set max_allowed_packet=100;
201
set global max_connect_errors=100;
175
202
set max_heap_table_size=100;
176
203
set max_join_size=100;
177
204
set max_sort_length=100;
205
set max_tmp_tables=100;
178
206
set global max_write_lock_count=100;
179
207
set global myisam_sort_buffer_size=100;
180
set global mysql_protocol_buffer_length=100;
208
set net_buffer_length=100;
209
set net_read_timeout=100;
210
set net_write_timeout=100;
181
211
set read_buffer_size=100;
182
212
set read_rnd_buffer_size=100;
183
213
set global server_id=100;
214
set global slow_launch_time=100;
184
215
set sort_buffer_size=100;
185
216
set sql_big_selects=1;
186
217
set sql_buffer_result=1;
218
set sql_safe_updates=1;
187
219
set sql_select_limit=1;
188
220
# reset it, so later tests don't get confused
189
221
set sql_select_limit=default;
193
225
set timestamp=1, timestamp=default;
194
226
set tmp_table_size=100;
195
227
set tx_isolation="READ-COMMITTED";
228
set wait_timeout=100;
234
create table t1 (a int not null auto_increment, primary key(a));
235
create table t2 (a int not null auto_increment, primary key(a));
236
insert into t1 values(null),(null),(null);
237
insert into t2 values(null),(null),(null);
238
set global key_buffer_size=100000;
239
select @@key_buffer_size;
240
select * from t1 where a=2;
241
select * from t2 where a=3;
243
select max(a) +1, max(a) +2 into @xx,@yy from t1;
255
select @@session.key_buffer_size;
258
set init_connect = NULL;
259
set global init_connect = NULL;
197
261
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
198
262
# expected: check that there is no overflow when 64-bit
339
418
# Bug #10339: read only variables.
342
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
343
422
set @@warning_count=1;
344
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
345
424
set @@global.error_count=1;
348
427
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
351
select VARIABLE_VALUE from data_dictionary.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
353
# We technically do not care about 32bit hardware. -Brian
354
#set @@max_heap_table_size= 4294967296;
355
#select @@max_heap_table_size > 0;
356
#set global max_heap_table_size= 4294967296;
357
#select @@max_heap_table_size > 0;
358
#set @@max_heap_table_size= 4294967296;
359
#select @@max_heap_table_size > 0;
430
set @@max_heap_table_size= 4294967296;
431
select @@max_heap_table_size > 0;
432
set global max_heap_table_size= 4294967296;
433
select @@max_heap_table_size > 0;
434
set @@max_heap_table_size= 4294967296;
435
select @@max_heap_table_size > 0;
362
438
# Bug #11775 Variable character_set_system does not exist (sometimes)
364
--error ER_UNKNOWN_SYSTEM_VARIABLE
365
441
select @@character_set_system;
366
--error ER_UNKNOWN_SYSTEM_VARIABLE
367
443
set global character_set_system = utf8;
368
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
369
445
set @@global.version_compile_os='234';
372
448
# Check character_set_filesystem variable invalid for Drizzle
374
--error ER_UNKNOWN_SYSTEM_VARIABLE
375
451
set @@global.character_set_filesystem=utf8;
376
--error ER_UNKNOWN_SYSTEM_VARIABLE
377
453
set character_set_filesystem=utf8;
380
456
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
382
set @sql_big_selects = @@sql_big_selects;
458
set @old_sql_big_selects = @@sql_big_selects;
383
459
set @@sql_big_selects = 1;
384
460
show variables like 'sql_big_selects';
385
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
386
#select * from data_dictionary.session_variables where variable_name like 'sql_big_selects';
387
set @@sql_big_selects = @sql_big_selects;
461
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
462
#select * from information_schema.session_variables where variable_name like 'sql_big_selects';
463
set @@sql_big_selects = @old_sql_big_selects;
390
466
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
393
469
set @@sql_notes = 0, @@sql_warnings = 0;
394
470
show variables like 'sql_notes';
395
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
396
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
471
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
472
#select * from information_schema.session_variables where variable_name like 'sql_notes';
397
473
show variables like 'sql_warnings';
398
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
399
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
474
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
475
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
400
476
set @@sql_notes = 1, @@sql_warnings = 1;
401
477
show variables like 'sql_notes';
402
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
403
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
478
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
479
#select * from information_schema.session_variables where variable_name like 'sql_notes';
404
480
show variables like 'sql_warnings';
405
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
406
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
481
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
482
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
485
# Bug #12792: @@system_time_zone is not SELECTable.
487
# Don't actually output, since it depends on the system
489
select @@system_time_zone;
409
492
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
423
506
--replace_column 2 #
424
507
show variables like 'basedir';
425
508
--replace_column 2 #
426
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
427
#select * from data_dictionary.session_variables where variable_name like 'basedir';
509
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
510
#select * from information_schema.session_variables where variable_name like 'basedir';
428
511
--replace_column 2 #
429
512
show variables like 'datadir';
430
513
--replace_column 2 #
431
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
432
#select * from data_dictionary.session_variables where variable_name like 'datadir';
514
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
515
#select * from information_schema.session_variables where variable_name like 'datadir';
433
516
--replace_column 2 #
434
517
show variables like 'tmpdir';
435
518
--replace_column 2 #
519
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
520
#select * from information_schema.session_variables where variable_name like 'tmpdir';
523
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
525
# Don't actually output, since it depends on the system
526
#--replace_column 1 # 2 # 3 # 4 # 5 #
527
# Not supported in Drizzle
528
#select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
529
#--replace_column 2 #
530
#show variables like 'ssl%';
531
#--replace_column 2 #
532
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
533
#select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
536
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
537
# and as @@log_queries_not_using_indexes
539
# Not valid in Drizzle
540
#select @@log_queries_not_using_indexes;
541
#show variables like 'log_queries_not_using_indexes';
542
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
543
#select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
438
546
# Bug#20908: Crash if select @@""
463
571
# Bug #19263: variables.test doesn't clean up after itself (II/II --
466
--error ER_UNKNOWN_SYSTEM_VARIABLE
574
set global connect_timeout =@my_connect_timeout;
575
set global flush =@my_flush;
467
577
set global flush_time =@my_flush_time;
578
set global key_buffer_size =@my_key_buffer_size;
579
set global max_connect_errors =@my_max_connect_errors;
468
580
set global max_heap_table_size =@my_max_heap_table_size;
469
581
set global max_join_size =@my_max_join_size;
583
#set global max_user_connections =default;
471
584
set global max_write_lock_count =default;
472
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
586
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
587
set global net_buffer_length =@my_net_buffer_length;
588
set global net_write_timeout =@my_net_write_timeout;
589
set global net_read_timeout =@my_net_read_timeout;
473
590
set global server_id =@my_server_id;
591
set global slow_launch_time =@my_slow_launch_time;
474
592
set global storage_engine =@my_storage_engine;
475
--error ER_UNKNOWN_SYSTEM_VARIABLE
476
594
set global thread_cache_size =@my_thread_cache_size;
477
set global myisam_sort_buffer_size =@my_myisam_sort_buffer_size;
479
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
480
SHOW LOCAL VARIABLES LIKE 'max_join_size';
482
set GLOBAL bulk_insert_buffer_size=DEFAULT;
483
set GLOBAL join_buffer_size=DEFAULT;
484
set GLOBAL max_allowed_packet=DEFAULT;
485
set GLOBAL max_heap_table_size=DEFAULT;
486
set GLOBAL max_join_size=DEFAULT;
487
set GLOBAL max_sort_length=DEFAULT;
488
set GLOBAL max_write_lock_count=DEFAULT;
489
set GLOBAL myisam_sort_buffer_size=DEFAULT;
490
set GLOBAL mysql_protocol_buffer_length=DEFAULT;
491
set GLOBAL read_buffer_size=DEFAULT;
492
set GLOBAL read_rnd_buffer_size=DEFAULT;
493
set GLOBAL server_id=DEFAULT;
494
set GLOBAL sort_buffer_size=DEFAULT;
495
set GLOBAL table_open_cache=DEFAULT;
496
set GLOBAL storage_engine= @my_storage_engine;
497
set GLOBAL tmp_table_size=DEFAULT;
498
set GLOBAL tx_isolation= @my_tx_isolation;
500
set SESSION bulk_insert_buffer_size=DEFAULT;
501
set SESSION join_buffer_size=DEFAULT;
502
set SESSION max_allowed_packet=DEFAULT;
503
set SESSION max_heap_table_size=DEFAULT;
504
set SESSION max_join_size=DEFAULT;
505
set SESSION max_sort_length=DEFAULT;
506
set SESSION read_buffer_size=DEFAULT;
507
set SESSION read_rnd_buffer_size=DEFAULT;
508
set SESSION sort_buffer_size=DEFAULT;
509
set SESSION sql_big_selects=DEFAULT;
510
set SESSION sql_buffer_result=DEFAULT;
511
set SESSION sql_select_limit=DEFAULT;
512
set SESSION sql_warnings=DEFAULT;
513
set SESSION storage_engine= @my_storage_engine;
514
set SESSION tmp_table_size=DEFAULT;
515
set SESSION tx_isolation= @my_tx_isolation;
518
597
# Bug#28580 Repeatation of status variables
521
599
--replace_column 2 #
522
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
601
#show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';