~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

Updated an include guard thanks to a nice catch during code review from Jay. Thanks Jay!

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#
9
9
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
10
10
#
11
 
set @my_myisam_key_cache_size           =@@global.myisam_key_cache_size;
 
11
set @my_key_buffer_size           =@@global.key_buffer_size;
12
12
set @my_max_connect_errors        =@@global.max_connect_errors;
13
13
set @my_max_heap_table_size       =@@global.max_heap_table_size;
14
14
set @my_max_join_size             =@@global.max_join_size;
15
 
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
 
15
set @my_drizzle_protocol_buffer_length =@@global.drizzle_protocol_buffer_length;
16
16
set @my_server_id                 =@@global.server_id;
17
17
set @my_storage_engine            =@@global.storage_engine;
18
18
set @my_myisam_sort_buffer_size   =@@global.myisam_sort_buffer_size;
64
64
set GLOBAL max_join_size=10;
65
65
set max_join_size=100;
66
66
show variables like 'max_join_size';
67
 
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
 
67
select * from information_schema.session_variables where variable_name like 'max_join_size';
68
68
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
69
69
show global variables like 'max_join_size';
70
70
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
71
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
71
select * from information_schema.global_variables where variable_name like 'max_join_size';
72
72
set GLOBAL max_join_size=2000;
73
73
show global variables like 'max_join_size';
74
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
74
select * from information_schema.global_variables where variable_name like 'max_join_size';
75
75
set max_join_size=DEFAULT;
76
76
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
77
77
show variables like 'max_join_size';
78
78
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
79
 
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
 
79
select * from information_schema.session_variables where variable_name like 'max_join_size';
80
80
set GLOBAL max_join_size=DEFAULT;
81
81
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
82
82
show global variables like 'max_join_size';
83
83
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
84
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
84
select * from information_schema.global_variables where variable_name like 'max_join_size';
85
85
set @@max_join_size=1000, @@global.max_join_size=2000;
86
86
select @@local.max_join_size, @@global.max_join_size;
87
87
select @@identity,  length(@@version)>0;
93
93
 
94
94
set global timed_mutexes=ON;
95
95
show variables like 'timed_mutexes';
96
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
96
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
97
97
set global timed_mutexes=0;
98
98
show variables like 'timed_mutexes';
99
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
99
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
100
100
 
101
101
set storage_engine=MYISAM, storage_engine="MEMORY";
102
102
show local variables like 'storage_engine';
103
 
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
 
103
select * from information_schema.session_variables where variable_name like 'storage_engine';
104
104
show global variables like 'storage_engine';
105
 
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
 
105
select * from information_schema.global_variables where variable_name like 'storage_engine';
106
106
 
107
107
set GLOBAL myisam_max_sort_file_size=2000000;
108
108
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';
 
109
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
110
110
set GLOBAL myisam_max_sort_file_size=default;
111
111
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
112
112
show global variables like 'myisam_max_sort_file_size';
113
113
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
 
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
 
114
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
115
115
 
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';
 
116
set global drizzle_protocol_buffer_length=1024;
 
117
show global variables like 'drizzle_protocol_buffer_%';
 
118
select * from information_schema.global_variables where variable_name like 'drizzle_protocol_buffer_%';
 
119
show global variables like 'drizzle_protocol_buffer_%';
 
120
select * from information_schema.global_variables where variable_name like 'drizzle_protocol_buffer_%';
 
121
set global drizzle_protocol_buffer_length=1;
 
122
show variables like 'drizzle_protocol_buffer_length';
123
123
#warning 1292
124
 
set global mysql_protocol_buffer_length=2000000000;
125
 
show variables like 'mysql_protocol_buffer_length';
 
124
set global drizzle_protocol_buffer_length=2000000000;
 
125
show variables like 'drizzle_protocol_buffer_length';
126
126
 
127
127
show variables like '%alloc%';
128
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
128
select * from information_schema.session_variables where variable_name like '%alloc%';
129
129
set @@range_alloc_block_size=1024*16;
130
130
set @@query_alloc_block_size=1024*17+2;
131
131
set @@query_prealloc_size=1024*18;
 
132
set @@transaction_alloc_block_size=1024*20-1;
 
133
set @@transaction_prealloc_size=1024*21-1;
132
134
select @@query_alloc_block_size;
133
135
show variables like '%alloc%';
134
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
136
select * from information_schema.session_variables where variable_name like '%alloc%';
135
137
set @@range_alloc_block_size=default;
136
138
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
 
139
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
137
140
show variables like '%alloc%';
138
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
141
select * from information_schema.session_variables where variable_name like '%alloc%';
139
142
 
140
143
#
141
144
# Bug #10904 Illegal mix of collations between
179
182
set max_sort_length=100;
180
183
set global max_write_lock_count=100;
181
184
set global myisam_sort_buffer_size=100;
182
 
set global mysql_protocol_buffer_length=100;
 
185
set global drizzle_protocol_buffer_length=100;
183
186
set read_buffer_size=100;
184
187
set read_rnd_buffer_size=100;
185
188
set global server_id=100;
204
207
create temporary table t2 (a int not null auto_increment, primary key(a));
205
208
insert into t1 values(null),(null),(null);
206
209
insert into t2 values(null),(null),(null);
207
 
set global myisam_key_cache_size=100000;
208
 
select @@myisam_key_cache_size;
 
210
set global key_buffer_size=100000;
 
211
select @@key_buffer_size;
209
212
select * from t1 where a=2;
210
213
select * from t2 where a=3;
211
214
check table t1,t2;
221
224
select 1;
222
225
 
223
226
--error 1238
224
 
select @@session.myisam_key_cache_size;
 
227
select @@session.key_buffer_size;
225
228
 
226
229
# init_connect was removed
227
230
#--error 1229
236
239
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
237
240
show global variables like 'myisam_max_sort_file_size';
238
241
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
239
 
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
 
242
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
240
243
set global myisam_max_sort_file_size=default;
241
244
 
242
245
## Bug #311084
259
262
# Bug#2586:Disallow global/session/local as structured var. instance names
260
263
#
261
264
--error 1193
262
 
set @@global.global.myisam_key_cache_size= 1;
 
265
set @@global.global.key_buffer_size= 1;
263
266
--error 1193
264
 
set GLOBAL global.myisam_key_cache_size= 1;
265
 
--error 1064
266
 
SELECT @@global.global.myisam_key_cache_size;
267
 
--error 1064
268
 
SELECT @@global.session.myisam_key_cache_size;
269
 
--error 1064
270
 
SELECT @@global.local.myisam_key_cache_size;
 
267
set GLOBAL global.key_buffer_size= 1;
 
268
--error 1064
 
269
SELECT @@global.global.key_buffer_size;
 
270
--error 1064
 
271
SELECT @@global.session.key_buffer_size;
 
272
--error 1064
 
273
SELECT @@global.local.key_buffer_size;
271
274
 
272
275
#
273
276
# BUG#4788 show create table provides incorrect statement
294
297
 
295
298
SET GLOBAL table_open_cache=-1;
296
299
SHOW VARIABLES LIKE 'table_open_cache';
297
 
SELECT * FROM DATA_DICTIONARY.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
 
300
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
298
301
SET GLOBAL table_open_cache=DEFAULT;
299
302
 
300
303
#
396
399
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
397
400
#
398
401
--disable_query_log
399
 
select VARIABLE_VALUE from data_dictionary.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
 
402
select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
400
403
--enable_query_log
401
404
# We technically do not care about 32bit hardware. -Brian
402
405
#set @@max_heap_table_size= 4294967296;
427
430
#
428
431
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
429
432
#
430
 
set @sql_big_selects = @@sql_big_selects;
 
433
set @old_sql_big_selects = @@sql_big_selects;
431
434
set @@sql_big_selects = 1;
432
435
show variables like 'sql_big_selects';
433
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
434
 
#select * from data_dictionary.session_variables where variable_name like 'sql_big_selects';
435
 
set @@sql_big_selects = @sql_big_selects;
 
436
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
437
#select * from information_schema.session_variables where variable_name like 'sql_big_selects';
 
438
set @@sql_big_selects = @old_sql_big_selects;
436
439
 
437
440
#
438
441
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
440
443
441
444
set @@sql_notes = 0, @@sql_warnings = 0;
442
445
show variables like 'sql_notes';
443
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
444
 
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
 
446
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
447
#select * from information_schema.session_variables where variable_name like 'sql_notes';
445
448
show variables like 'sql_warnings';
446
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
447
 
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
 
449
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
450
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
448
451
set @@sql_notes = 1, @@sql_warnings = 1;
449
452
show variables like 'sql_notes';
450
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
451
 
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
 
453
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
454
#select * from information_schema.session_variables where variable_name like 'sql_notes';
452
455
show variables like 'sql_warnings';
453
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
454
 
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
 
456
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
457
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
455
458
 
456
459
#
457
460
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
471
474
--replace_column 2 #
472
475
show variables like 'basedir';
473
476
--replace_column 2 #
474
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
475
 
#select * from data_dictionary.session_variables where variable_name like 'basedir';
 
477
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
478
#select * from information_schema.session_variables where variable_name like 'basedir';
476
479
--replace_column 2 #
477
480
show variables like 'datadir';
478
481
--replace_column 2 #
479
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
480
 
#select * from data_dictionary.session_variables where variable_name like 'datadir';
 
482
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
483
#select * from information_schema.session_variables where variable_name like 'datadir';
481
484
--replace_column 2 #
482
485
show variables like 'tmpdir';
483
486
--replace_column 2 #
 
487
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
488
#select * from information_schema.session_variables where variable_name like 'tmpdir';
 
489
 
 
490
#
 
491
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
 
492
 
493
# Don't actually output, since it depends on the system
 
494
#--replace_column 1 # 2 # 3 # 4 # 5 #
 
495
# Not supported in Drizzle
 
496
#select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
 
497
#--replace_column 2 #
 
498
#show variables like 'ssl%';
 
499
#--replace_column 2 #
 
500
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
501
#select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
 
502
 
 
503
#
 
504
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
 
505
# and as @@log_queries_not_using_indexes
 
506
#
 
507
# Not valid in Drizzle
 
508
#select @@log_queries_not_using_indexes;
 
509
#show variables like 'log_queries_not_using_indexes';
 
510
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
511
#select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
484
512
 
485
513
#
486
514
# Bug#20908: Crash if select @@""
513
541
#
514
542
--error 1193
515
543
set global flush_time                =@my_flush_time;
516
 
set global myisam_key_cache_size           =@my_myisam_key_cache_size;
 
544
set global key_buffer_size           =@my_key_buffer_size;
517
545
set global max_connect_errors        =@my_max_connect_errors;
518
546
set global max_heap_table_size       =@my_max_heap_table_size;
519
547
set global max_join_size             =@my_max_join_size;
521
549
set global max_write_lock_count      =default;
522
550
--error 1232
523
551
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
524
 
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
 
552
set global drizzle_protocol_buffer_length= @my_drizzle_protocol_buffer_length;
525
553
set global server_id                 =@my_server_id;
526
554
set global storage_engine            =@my_storage_engine;
527
555
--error 1193