5
5
drop table if exists t1,t2;
6
drop schema if exists data_dictionary;
9
10
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
12
set @my_myisam_key_cache_size =@@global.myisam_key_cache_size;
13
set @my_max_connect_errors =@@global.max_connect_errors;
11
14
set @my_max_heap_table_size =@@global.max_heap_table_size;
12
15
set @my_max_join_size =@@global.max_join_size;
13
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
16
set @my_drizzle_protocol_buffer_length =@@global.drizzle_protocol_buffer_length;
14
17
set @my_server_id =@@global.server_id;
15
18
set @my_storage_engine =@@global.storage_engine;
16
19
set @my_myisam_sort_buffer_size =@@global.myisam_sort_buffer_size;
17
set @my_tx_isolation =@@global.tx_isolation;
19
21
# case insensitivity tests (new in 5.0)
112
114
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
113
115
select * from data_dictionary.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';
117
set global drizzle_protocol_buffer_length=1024;
118
show global variables like 'drizzle_protocol_buffer_%';
119
select * from data_dictionary.global_variables where variable_name like 'drizzle_protocol_buffer_%';
120
show global variables like 'drizzle_protocol_buffer_%';
121
select * from data_dictionary.global_variables where variable_name like 'drizzle_protocol_buffer_%';
122
set global drizzle_protocol_buffer_length=1;
123
show variables like 'drizzle_protocol_buffer_length';
123
set global mysql_protocol_buffer_length=2000000000;
124
show variables like 'mysql_protocol_buffer_length';
125
set global drizzle_protocol_buffer_length=2000000000;
126
show variables like 'drizzle_protocol_buffer_length';
126
128
show variables like '%alloc%';
127
129
select * from data_dictionary.session_variables where variable_name like '%alloc%';
146
148
# The following should give errors
148
--error ER_UNKNOWN_SYSTEM_VARIABLE
149
151
set unknown_variable=1;
150
--error ER_WRONG_TYPE_FOR_VAR
151
153
set max_join_size="hello";
152
--error ER_UNKNOWN_STORAGE_ENGINE
153
155
set storage_engine=UNKNOWN_TABLE_TYPE;
154
--error ER_NO_DEFAULT
155
157
set GLOBAL storage_engine=DEFAULT;
156
--error ER_LOCAL_VARIABLE
157
159
set global autocommit=1;
158
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
159
161
select @@global.timestamp;
160
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
161
163
set @@version='';
162
--error ER_GLOBAL_VARIABLE
163
165
set myisam_max_sort_file_size=100;
164
--error ER_WRONG_VALUE_FOR_VAR
165
167
set @@SQL_WARNINGS=NULL;
167
169
# Test setting all variables
172
174
set join_buffer_size=100;
173
175
set last_insert_id=1;
174
176
set max_allowed_packet=100;
177
set global max_connect_errors=100;
175
178
set max_heap_table_size=100;
176
179
set max_join_size=100;
177
180
set max_sort_length=100;
178
181
set global max_write_lock_count=100;
179
182
set global myisam_sort_buffer_size=100;
180
set global mysql_protocol_buffer_length=100;
183
set global drizzle_protocol_buffer_length=100;
181
184
set read_buffer_size=100;
182
185
set read_rnd_buffer_size=100;
183
186
set global server_id=100;
194
197
set tmp_table_size=100;
195
198
set tx_isolation="READ-COMMITTED";
204
create temporary table t1 (a int not null auto_increment, primary key(a));
205
create temporary table t2 (a int not null auto_increment, primary key(a));
206
insert into t1 values(null),(null),(null);
207
insert into t2 values(null),(null),(null);
208
set global myisam_key_cache_size=100000;
209
select @@myisam_key_cache_size;
210
select * from t1 where a=2;
211
select * from t2 where a=3;
213
select max(a) +1, max(a) +2 into @xx,@yy from t1;
225
select @@session.myisam_key_cache_size;
227
# init_connect was removed
229
#set init_connect = NULL;
230
#set global init_connect = NULL;
197
232
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
198
233
# expected: check that there is no overflow when 64-bit
199
234
# variables are set
260
# Bug#2586:Disallow global/session/local as structured var. instance names
263
set @@global.global.myisam_key_cache_size= 1;
265
set GLOBAL global.myisam_key_cache_size= 1;
267
SELECT @@global.global.myisam_key_cache_size;
269
SELECT @@global.session.myisam_key_cache_size;
271
SELECT @@global.local.myisam_key_cache_size;
225
274
# BUG#4788 show create table provides incorrect statement
227
276
# What default width have numeric types?
266
315
--echo *** LC_TIME_NAMES: testing with string expressions
267
316
set lc_time_names=concat('de','_','DE');
268
317
select @@lc_time_names;
269
--error ER_UNKNOWN_ERROR
270
319
set lc_time_names=concat('de','+','DE');
271
320
select @@lc_time_names;
272
321
--echo LC_TIME_NAMES: testing with numeric expressions
273
322
set @@lc_time_names=1+2;
274
323
select @@lc_time_names;
275
--error ER_WRONG_TYPE_FOR_VAR
276
325
set @@lc_time_names=1/0;
277
326
select @@lc_time_names;
278
327
set lc_time_names=en_US;
279
328
--echo LC_TIME_NAMES: testing NULL and a negative number:
280
--error ER_WRONG_VALUE_FOR_VAR
281
330
set lc_time_names=NULL;
282
--error ER_UNKNOWN_ERROR
283
332
set lc_time_names=-1;
284
333
select @@lc_time_names;
285
334
--echo LC_TIME_NAMES: testing locale with the last ID:
286
335
set lc_time_names=108;
287
336
select @@lc_time_names;
288
337
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
289
--error ER_UNKNOWN_ERROR
290
339
set lc_time_names=109;
291
340
select @@lc_time_names;
292
341
--echo LC_TIME_NAMES: testing that 0 is en_US:
362
411
# Bug #11775 Variable character_set_system does not exist (sometimes)
364
--error ER_UNKNOWN_SYSTEM_VARIABLE
365
414
select @@character_set_system;
366
--error ER_UNKNOWN_SYSTEM_VARIABLE
367
416
set global character_set_system = utf8;
368
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
369
418
set @@global.version_compile_os='234';
372
421
# Check character_set_filesystem variable invalid for Drizzle
374
--error ER_UNKNOWN_SYSTEM_VARIABLE
375
424
set @@global.character_set_filesystem=utf8;
376
--error ER_UNKNOWN_SYSTEM_VARIABLE
377
426
set character_set_filesystem=utf8;
463
512
# Bug #19263: variables.test doesn't clean up after itself (II/II --
466
--error ER_UNKNOWN_SYSTEM_VARIABLE
467
516
set global flush_time =@my_flush_time;
517
set global myisam_key_cache_size =@my_myisam_key_cache_size;
518
set global max_connect_errors =@my_max_connect_errors;
468
519
set global max_heap_table_size =@my_max_heap_table_size;
469
520
set global max_join_size =@my_max_join_size;
471
522
set global max_write_lock_count =default;
472
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
524
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
525
set global drizzle_protocol_buffer_length= @my_drizzle_protocol_buffer_length;
473
526
set global server_id =@my_server_id;
474
527
set global storage_engine =@my_storage_engine;
475
--error ER_UNKNOWN_SYSTEM_VARIABLE
476
529
set global thread_cache_size =@my_thread_cache_size;
477
530
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
533
# Bug#28580 Repeatation of status variables
521
535
--replace_column 2 #
522
536
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';