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;
11
14
set @my_max_connect_errors =@@global.max_connect_errors;
12
15
set @my_max_heap_table_size =@@global.max_heap_table_size;
13
16
set @my_max_join_size =@@global.max_join_size;
14
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;
15
20
set @my_server_id =@@global.server_id;
21
set @my_slow_launch_time =@@global.slow_launch_time;
16
22
set @my_storage_engine =@@global.storage_engine;
17
set @my_myisam_sort_buffer_size =@@global.myisam_sort_buffer_size;
18
set @my_tx_isolation =@@global.tx_isolation;
20
24
# case insensitivity tests (new in 5.0)
64
68
set GLOBAL max_join_size=10;
65
69
set max_join_size=100;
66
70
show variables like 'max_join_size';
67
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';
68
72
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
69
73
show global variables like 'max_join_size';
70
74
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
71
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';
72
76
set GLOBAL max_join_size=2000;
73
77
show global variables like 'max_join_size';
74
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';
75
79
set max_join_size=DEFAULT;
76
80
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
77
81
show variables like 'max_join_size';
78
82
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
79
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';
80
84
set GLOBAL max_join_size=DEFAULT;
81
85
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
82
86
show global variables like 'max_join_size';
83
87
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
84
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';
85
89
set @@max_join_size=1000, @@global.max_join_size=2000;
86
90
select @@local.max_join_size, @@global.max_join_size;
87
91
select @@identity, length(@@version)>0;
94
98
set global timed_mutexes=ON;
95
99
show variables like 'timed_mutexes';
96
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';
97
101
set global timed_mutexes=0;
98
102
show variables like 'timed_mutexes';
99
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';
101
set storage_engine=MYISAM, storage_engine="MEMORY";
105
set storage_engine=MYISAM, storage_engine="HEAP";
102
106
show local variables like 'storage_engine';
103
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';
104
108
show global variables like 'storage_engine';
105
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';
107
111
set GLOBAL myisam_max_sort_file_size=2000000;
108
112
show global variables like 'myisam_max_sort_file_size';
109
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';
110
114
set GLOBAL myisam_max_sort_file_size=default;
111
115
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
112
116
show global variables like 'myisam_max_sort_file_size';
113
117
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
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';
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';
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';
124
set global mysql_protocol_buffer_length=2000000000;
125
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';
127
140
show variables like '%alloc%';
128
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;
129
142
set @@range_alloc_block_size=1024*16;
130
143
set @@query_alloc_block_size=1024*17+2;
131
144
set @@query_prealloc_size=1024*18;
145
set @@transaction_alloc_block_size=1024*20-1;
146
set @@transaction_prealloc_size=1024*21-1;
132
147
select @@query_alloc_block_size;
133
148
show variables like '%alloc%';
134
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;
135
150
set @@range_alloc_block_size=default;
136
151
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
152
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
137
153
show variables like '%alloc%';
138
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;
141
157
# Bug #10904 Illegal mix of collations between
147
163
# The following should give errors
149
--error ER_UNKNOWN_SYSTEM_VARIABLE
150
166
set unknown_variable=1;
151
--error ER_WRONG_TYPE_FOR_VAR
152
168
set max_join_size="hello";
153
--error ER_UNKNOWN_STORAGE_ENGINE
154
170
set storage_engine=UNKNOWN_TABLE_TYPE;
155
--error ER_NO_DEFAULT
156
172
set GLOBAL storage_engine=DEFAULT;
157
--error ER_LOCAL_VARIABLE
158
174
set global autocommit=1;
159
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
160
176
select @@global.timestamp;
161
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
162
178
set @@version='';
163
--error ER_GLOBAL_VARIABLE
164
180
set myisam_max_sort_file_size=100;
165
--error ER_WRONG_VALUE_FOR_VAR
166
182
set @@SQL_WARNINGS=NULL;
168
184
# Test setting all variables
170
186
set autocommit=1;
171
187
select @@autocommit;
172
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;
173
197
set join_buffer_size=100;
174
198
set last_insert_id=1;
199
set global local_infile=1;
175
200
set max_allowed_packet=100;
176
201
set global max_connect_errors=100;
177
202
set max_heap_table_size=100;
178
203
set max_join_size=100;
179
204
set max_sort_length=100;
205
set max_tmp_tables=100;
180
206
set global max_write_lock_count=100;
181
207
set global myisam_sort_buffer_size=100;
182
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;
183
211
set read_buffer_size=100;
184
212
set read_rnd_buffer_size=100;
185
213
set global server_id=100;
214
set global slow_launch_time=100;
186
215
set sort_buffer_size=100;
187
216
set sql_big_selects=1;
188
217
set sql_buffer_result=1;
218
set sql_safe_updates=1;
189
219
set sql_select_limit=1;
190
220
# reset it, so later tests don't get confused
191
221
set sql_select_limit=default;
195
225
set timestamp=1, timestamp=default;
196
226
set tmp_table_size=100;
197
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;
199
261
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
200
262
# expected: check that there is no overflow when 64-bit
341
418
# Bug #10339: read only variables.
344
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
345
422
set @@warning_count=1;
346
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
347
424
set @@global.error_count=1;
350
427
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
353
select VARIABLE_VALUE from data_dictionary.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
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;
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;
364
438
# Bug #11775 Variable character_set_system does not exist (sometimes)
366
--error ER_UNKNOWN_SYSTEM_VARIABLE
367
441
select @@character_set_system;
368
--error ER_UNKNOWN_SYSTEM_VARIABLE
369
443
set global character_set_system = utf8;
370
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
371
445
set @@global.version_compile_os='234';
374
448
# Check character_set_filesystem variable invalid for Drizzle
376
--error ER_UNKNOWN_SYSTEM_VARIABLE
377
451
set @@global.character_set_filesystem=utf8;
378
--error ER_UNKNOWN_SYSTEM_VARIABLE
379
453
set character_set_filesystem=utf8;
382
456
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
384
set @sql_big_selects = @@sql_big_selects;
458
set @old_sql_big_selects = @@sql_big_selects;
385
459
set @@sql_big_selects = 1;
386
460
show variables like 'sql_big_selects';
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;
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;
392
466
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
395
469
set @@sql_notes = 0, @@sql_warnings = 0;
396
470
show variables like 'sql_notes';
397
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
398
#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';
399
473
show variables like 'sql_warnings';
400
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
401
#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';
402
476
set @@sql_notes = 1, @@sql_warnings = 1;
403
477
show variables like 'sql_notes';
404
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
405
#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';
406
480
show variables like 'sql_warnings';
407
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
408
#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';
411
485
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
425
499
--replace_column 2 #
426
500
show variables like 'basedir';
427
501
--replace_column 2 #
428
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
429
#select * from data_dictionary.session_variables where variable_name like 'basedir';
502
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
503
#select * from information_schema.session_variables where variable_name like 'basedir';
430
504
--replace_column 2 #
431
505
show variables like 'datadir';
432
506
--replace_column 2 #
433
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
434
#select * from data_dictionary.session_variables where variable_name like 'datadir';
507
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
508
#select * from information_schema.session_variables where variable_name like 'datadir';
435
509
--replace_column 2 #
436
510
show variables like 'tmpdir';
437
511
--replace_column 2 #
512
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
513
#select * from information_schema.session_variables where variable_name like 'tmpdir';
516
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
518
# Don't actually output, since it depends on the system
519
#--replace_column 1 # 2 # 3 # 4 # 5 #
520
# Not supported in Drizzle
521
#select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
522
#--replace_column 2 #
523
#show variables like 'ssl%';
524
#--replace_column 2 #
525
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
526
#select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
529
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
530
# and as @@log_queries_not_using_indexes
532
# Not valid in Drizzle
533
#select @@log_queries_not_using_indexes;
534
#show variables like 'log_queries_not_using_indexes';
535
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
536
#select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
440
539
# Bug#20908: Crash if select @@""
465
564
# Bug #19263: variables.test doesn't clean up after itself (II/II --
468
--error ER_UNKNOWN_SYSTEM_VARIABLE
567
set global connect_timeout =@my_connect_timeout;
568
set global flush =@my_flush;
469
570
set global flush_time =@my_flush_time;
571
set global key_buffer_size =@my_key_buffer_size;
470
572
set global max_connect_errors =@my_max_connect_errors;
471
573
set global max_heap_table_size =@my_max_heap_table_size;
472
574
set global max_join_size =@my_max_join_size;
576
#set global max_user_connections =default;
474
577
set global max_write_lock_count =default;
475
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
579
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
580
set global net_buffer_length =@my_net_buffer_length;
581
set global net_write_timeout =@my_net_write_timeout;
582
set global net_read_timeout =@my_net_read_timeout;
476
583
set global server_id =@my_server_id;
584
set global slow_launch_time =@my_slow_launch_time;
477
585
set global storage_engine =@my_storage_engine;
478
--error ER_UNKNOWN_SYSTEM_VARIABLE
479
587
set global thread_cache_size =@my_thread_cache_size;
480
set global myisam_sort_buffer_size =@my_myisam_sort_buffer_size;
482
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
483
SHOW LOCAL VARIABLES LIKE 'max_join_size';
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;
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;
522
590
# Bug#28580 Repeatation of status variables
525
592
--replace_column 2 #
526
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
594
#show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';