~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

  • Committer: Stewart Smith
  • Date: 2010-02-15 03:55:09 UTC
  • mto: (1273.13.96 build)
  • mto: This revision was merged to the branch mainline in revision 1308.
  • Revision ID: stewart@flamingspork.com-20100215035509-y6sry4q4yymph2by
move SUBSTR, SUBSTRING and SUBSTR_INDEX to plugins. add parser hooks for substr being a plugin now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
--disable_warnings
5
5
drop table if exists t1,t2;
 
6
drop schema if exists data_dictionary;
6
7
--enable_warnings
7
8
 
 
9
create schema data_dictionary;
 
10
 
8
11
#
9
12
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
10
13
#
 
14
set @my_myisam_key_cache_size           =@@global.myisam_key_cache_size;
11
15
set @my_max_connect_errors        =@@global.max_connect_errors;
12
16
set @my_max_heap_table_size       =@@global.max_heap_table_size;
13
17
set @my_max_join_size             =@@global.max_join_size;
14
 
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
 
18
set @my_drizzle_protocol_buffer_length =@@global.drizzle_protocol_buffer_length;
15
19
set @my_server_id                 =@@global.server_id;
16
20
set @my_storage_engine            =@@global.storage_engine;
17
21
set @my_myisam_sort_buffer_size   =@@global.myisam_sort_buffer_size;
18
 
set @my_tx_isolation      =@@global.tx_isolation;
19
22
 
20
23
# case insensitivity tests (new in 5.0)
21
24
set @`test`=1;
113
116
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
117
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
115
118
 
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';
 
119
set global drizzle_protocol_buffer_length=1024;
 
120
show global variables like 'drizzle_protocol_buffer_%';
 
121
select * from data_dictionary.global_variables where variable_name like 'drizzle_protocol_buffer_%';
 
122
show global variables like 'drizzle_protocol_buffer_%';
 
123
select * from data_dictionary.global_variables where variable_name like 'drizzle_protocol_buffer_%';
 
124
set global drizzle_protocol_buffer_length=1;
 
125
show variables like 'drizzle_protocol_buffer_length';
123
126
#warning 1292
124
 
set global mysql_protocol_buffer_length=2000000000;
125
 
show variables like 'mysql_protocol_buffer_length';
 
127
set global drizzle_protocol_buffer_length=2000000000;
 
128
show variables like 'drizzle_protocol_buffer_length';
126
129
 
127
130
show variables like '%alloc%';
128
131
select * from data_dictionary.session_variables where variable_name like '%alloc%';
146
149
 
147
150
# The following should give errors
148
151
 
149
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
152
--error 1193
150
153
set unknown_variable=1;
151
 
--error ER_WRONG_TYPE_FOR_VAR
 
154
--error 1232
152
155
set max_join_size="hello";
153
 
--error ER_UNKNOWN_STORAGE_ENGINE
 
156
--error 1286
154
157
set storage_engine=UNKNOWN_TABLE_TYPE;
155
 
--error ER_NO_DEFAULT
 
158
--error 1230
156
159
set GLOBAL storage_engine=DEFAULT;
157
 
--error ER_LOCAL_VARIABLE
 
160
--error 1228
158
161
set global autocommit=1;
159
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
162
--error 1238
160
163
select @@global.timestamp;
161
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR 
 
164
--error 1238 
162
165
set @@version='';
163
 
--error ER_GLOBAL_VARIABLE
 
166
--error 1229
164
167
set myisam_max_sort_file_size=100;
165
 
--error ER_WRONG_VALUE_FOR_VAR
 
168
--error 1231
166
169
set @@SQL_WARNINGS=NULL;
167
170
 
168
171
# Test setting all variables
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;
196
199
set tmp_table_size=100;
197
200
set tx_isolation="READ-COMMITTED";
198
201
 
 
202
#
 
203
# key buffer
 
204
#
 
205
 
 
206
create temporary table t1 (a int not null auto_increment, primary key(a));
 
207
create temporary table t2 (a int not null auto_increment, primary key(a));
 
208
insert into t1 values(null),(null),(null);
 
209
insert into t2 values(null),(null),(null);
 
210
set global myisam_key_cache_size=100000;
 
211
select @@myisam_key_cache_size;
 
212
select * from t1 where a=2;
 
213
select * from t2 where a=3;
 
214
check table t1,t2;
 
215
select max(a) +1, max(a) +2 into @xx,@yy from t1;
 
216
drop table t1,t2;
 
217
 
 
218
#
 
219
# error conditions
 
220
#
 
221
 
 
222
--error 1193
 
223
select @@xxxxxxxxxx;
 
224
select 1;
 
225
 
 
226
--error 1238
 
227
select @@session.myisam_key_cache_size;
 
228
 
 
229
# init_connect was removed
 
230
#--error 1229
 
231
#set init_connect = NULL;
 
232
#set global init_connect = NULL;
 
233
 
199
234
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
200
235
# expected: check that there is no overflow when 64-bit
201
236
# variables are set
224
259
#select @a, @b;
225
260
 
226
261
#
 
262
# Bug#2586:Disallow global/session/local as structured var. instance names
 
263
#
 
264
--error 1193
 
265
set @@global.global.myisam_key_cache_size= 1;
 
266
--error 1193
 
267
set GLOBAL global.myisam_key_cache_size= 1;
 
268
--error 1064
 
269
SELECT @@global.global.myisam_key_cache_size;
 
270
--error 1064
 
271
SELECT @@global.session.myisam_key_cache_size;
 
272
--error 1064
 
273
SELECT @@global.local.myisam_key_cache_size;
 
274
 
 
275
#
227
276
# BUG#4788 show create table provides incorrect statement
228
277
#
229
278
# What default width have numeric types?
268
317
--echo *** LC_TIME_NAMES: testing with string expressions
269
318
set lc_time_names=concat('de','_','DE');
270
319
select @@lc_time_names;
271
 
--error ER_UNKNOWN_ERROR
 
320
--error 1105
272
321
set lc_time_names=concat('de','+','DE');
273
322
select @@lc_time_names;
274
323
--echo LC_TIME_NAMES: testing with numeric expressions
275
324
set @@lc_time_names=1+2;
276
325
select @@lc_time_names;
277
 
--error ER_WRONG_TYPE_FOR_VAR
 
326
--error 1232
278
327
set @@lc_time_names=1/0;
279
328
select @@lc_time_names;
280
329
set lc_time_names=en_US;
281
330
--echo LC_TIME_NAMES: testing NULL and a negative number:
282
 
--error ER_WRONG_VALUE_FOR_VAR
 
331
--error 1231
283
332
set lc_time_names=NULL;
284
 
--error ER_UNKNOWN_ERROR
 
333
--error 1105
285
334
set lc_time_names=-1;
286
335
select @@lc_time_names;
287
336
--echo LC_TIME_NAMES: testing locale with the last ID:
288
337
set lc_time_names=108;
289
338
select @@lc_time_names;
290
339
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
291
 
--error ER_UNKNOWN_ERROR
 
340
--error 1105
292
341
set lc_time_names=109;
293
342
select @@lc_time_names;
294
343
--echo LC_TIME_NAMES: testing that 0 is en_US:
341
390
# Bug #10339: read only variables.
342
391
#
343
392
 
344
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
393
--error 1238
345
394
set @@warning_count=1;
346
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
395
--error 1238
347
396
set @@global.error_count=1;
348
397
 
349
398
#
363
412
#
364
413
# Bug #11775 Variable character_set_system does not exist (sometimes)
365
414
#
366
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
415
--error 1193
367
416
select @@character_set_system;
368
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
417
--error 1193
369
418
set global character_set_system = utf8;
370
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
419
--error 1238
371
420
set @@global.version_compile_os='234';
372
421
 
373
422
#
374
423
# Check character_set_filesystem variable invalid for Drizzle
375
424
#
376
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
425
--error 1193
377
426
set @@global.character_set_filesystem=utf8;
378
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
427
--error 1193
379
428
set character_set_filesystem=utf8;
380
429
 
381
430
#
452
501
# Don't actually output, since it depends on the system
453
502
--replace_column 1 #
454
503
select @@hostname;
455
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
504
--error 1238
456
505
set @@hostname= "anothername";
457
506
--replace_column 2 #
458
507
show variables like 'hostname';
465
514
# Bug #19263: variables.test doesn't clean up after itself (II/II --
466
515
# restore)
467
516
#
468
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
517
--error 1193
469
518
set global flush_time                =@my_flush_time;
 
519
set global myisam_key_cache_size           =@my_myisam_key_cache_size;
470
520
set global max_connect_errors        =@my_max_connect_errors;
471
521
set global max_heap_table_size       =@my_max_heap_table_size;
472
522
set global max_join_size             =@my_max_join_size;
473
523
# No default
474
524
set global max_write_lock_count      =default;
475
 
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
 
525
--error 1232
 
526
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
 
527
set global drizzle_protocol_buffer_length= @my_drizzle_protocol_buffer_length;
476
528
set global server_id                 =@my_server_id;
477
529
set global storage_engine            =@my_storage_engine;
478
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
530
--error 1193
479
531
set global thread_cache_size         =@my_thread_cache_size;
480
532
set global myisam_sort_buffer_size   =@my_myisam_sort_buffer_size;
481
533
 
482
 
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
483
 
SHOW LOCAL VARIABLES LIKE 'max_join_size';
484
 
 
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;
503
 
 
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;
520
 
 
521
534
#
522
535
# Bug#28580 Repeatation of status variables
523
536
#
524
 
 
525
537
--replace_column 2 #
526
538
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
527
539
 
 
540
drop schema data_dictionary;