~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

  • Committer: Brian Aker
  • Date: 2009-05-15 17:06:35 UTC
  • mto: This revision was merged to the branch mainline in revision 1023.
  • Revision ID: brian@gaz-20090515170635-croy1u63a3gqdn9n
Dead convert functions for character sets.

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_binlog_cache_size         =@@global.binlog_cache_size;
12
11
set @my_connect_timeout           =@@global.connect_timeout;
13
12
set @my_flush                     =@@global.flush;
14
 
set @my_flush_time                =@@global.flush_time;
15
13
set @my_key_buffer_size           =@@global.key_buffer_size;
16
 
set @my_max_binlog_cache_size     =@@global.max_binlog_cache_size;
17
 
set @my_max_binlog_size           =@@global.max_binlog_size;
18
14
set @my_max_connect_errors        =@@global.max_connect_errors;
19
 
set @my_max_connections           =@@global.max_connections;
20
15
set @my_max_heap_table_size       =@@global.max_heap_table_size;
21
16
set @my_max_join_size             =@@global.max_join_size;
22
 
set @my_myisam_data_pointer_size  =@@global.myisam_data_pointer_size;
23
17
set @my_net_buffer_length         =@@global.net_buffer_length;
24
18
set @my_net_write_timeout         =@@global.net_write_timeout;
25
19
set @my_net_read_timeout          =@@global.net_read_timeout;
26
 
set @my_rpl_recovery_rank         =@@global.rpl_recovery_rank;
27
20
set @my_server_id                 =@@global.server_id;
28
 
set @my_slow_launch_time          =@@global.slow_launch_time;
29
21
set @my_storage_engine            =@@global.storage_engine;
30
 
set @my_thread_cache_size         =@@global.thread_cache_size;
31
22
 
32
23
# case insensitivity tests (new in 5.0)
33
24
set @`test`=1;
61
52
# Test problem with WHERE and variables
62
53
#
63
54
 
64
 
CREATE TABLE t1 (c_id INT(4) NOT NULL, c_name CHAR(20), c_country CHAR(3), PRIMARY KEY(c_id));
 
55
CREATE TABLE t1 (c_id INT NOT NULL, c_name VARCHAR(250), c_country VARCHAR(250), PRIMARY KEY(c_id));
65
56
INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB');
66
57
SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1;
67
58
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid;
103
94
select @@IDENTITY,last_insert_id(), @@identity;
104
95
explain extended select @@IDENTITY,last_insert_id(), @@identity;
105
96
 
106
 
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
107
 
 
108
 
set global concurrent_insert=2;
109
 
show variables like 'concurrent_insert';
110
 
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
111
 
set global concurrent_insert=1;
112
 
show variables like 'concurrent_insert';
113
 
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
114
 
set global concurrent_insert=0;
115
 
show variables like 'concurrent_insert';
116
 
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
117
 
# no global value set global concurrent_insert=DEFAULT;
118
 
select @@concurrent_insert;
119
 
 
120
97
set global timed_mutexes=ON;
121
98
show variables like 'timed_mutexes';
122
99
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
159
136
show variables like 'net_buffer_length';
160
137
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
161
138
 
162
 
set character set cp1251_koi8;
163
 
show variables like "character_set_client";
164
 
select * from information_schema.session_variables where variable_name like 'character_set_client';
165
 
select @@timestamp>0;
166
 
 
167
 
set @@rand_seed1=10000000,@@rand_seed2=1000000;
168
 
select ROUND(RAND(),5);
169
 
 
170
139
show variables like '%alloc%';
171
140
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
172
141
set @@range_alloc_block_size=1024*16;
192
161
 
193
162
# The following should give errors
194
163
 
195
 
--error 1231
196
 
set big_tables=OFFF;
197
 
--error 1231
198
 
set big_tables="OFFF";
199
164
--error 1193
200
165
set unknown_variable=1;
201
166
--error 1232
204
169
set storage_engine=UNKNOWN_TABLE_TYPE;
205
170
--error 1230
206
171
set GLOBAL storage_engine=DEFAULT;
207
 
--error 1115
208
 
set character_set_client=UNKNOWN_CHARACTER_SET;
209
 
--error 1273
210
 
set collation_connection=UNKNOWN_COLLATION;
211
 
--error 1231
212
 
set character_set_client=NULL;
213
 
--error 1231
214
 
set collation_connection=NULL;
215
172
--error 1228
216
173
set global autocommit=1;
217
174
--error 1238
219
176
--error 1238 
220
177
set @@version='';
221
178
--error 1229
222
 
set @@concurrent_insert=1;
223
 
--error 1228
224
 
set @@global.sql_auto_is_null=1;
225
 
--error 1238
226
 
select @@global.sql_auto_is_null;
227
 
--error 1229
228
179
set myisam_max_sort_file_size=100;
229
180
--error 1231
230
181
set @@SQL_WARNINGS=NULL;
232
183
# Test setting all variables
233
184
 
234
185
set autocommit=1;
235
 
set big_tables=1;
236
 
select @@autocommit, @@big_tables;
237
 
set global binlog_cache_size=100;
 
186
select @@autocommit;
238
187
set bulk_insert_buffer_size=100;
239
 
set character set cp1251_koi8;
240
 
set character set default;
241
 
set @@global.concurrent_insert=1;
242
188
set global connect_timeout=100;
243
189
select @@delay_key_write;
244
190
set global delay_key_write="OFF";
245
191
select @@delay_key_write;
246
192
set global delay_key_write=ALL;
247
 
select @@delay_key_write;
248
193
set global delay_key_write=1;
249
194
select @@delay_key_write;
250
 
set global flush=1;
251
 
set global flush_time=100;
252
 
set insert_id=1;
253
 
set interactive_timeout=100;
254
195
set join_buffer_size=100;
255
196
set last_insert_id=1;
256
 
set global local_infile=1;
257
 
set long_query_time=0.000001;
258
 
select @@long_query_time;
259
 
set long_query_time=100.000001;
260
 
select @@long_query_time;
261
 
set low_priority_updates=1;
262
197
set max_allowed_packet=100;
263
 
set global max_binlog_cache_size=100;
264
 
set global max_binlog_size=100;
265
198
set global max_connect_errors=100;
266
 
set global max_connections=100;
267
199
set max_heap_table_size=100;
268
200
set max_join_size=100;
269
201
set max_sort_length=100;
270
202
set max_tmp_tables=100;
271
 
set global max_user_connections=100;
272
 
select @@max_user_connections;
273
203
set global max_write_lock_count=100;
274
 
set myisam_sort_buffer_size=100;
 
204
set global myisam_sort_buffer_size=100;
275
205
set net_buffer_length=100;
276
206
set net_read_timeout=100;
277
207
set net_write_timeout=100;
278
208
set read_buffer_size=100;
279
209
set read_rnd_buffer_size=100;
280
 
set global rpl_recovery_rank=100;
281
210
set global server_id=100;
282
 
set global slow_launch_time=100;
283
211
set sort_buffer_size=100;
284
 
set @@max_sp_recursion_depth=10;
285
 
select @@max_sp_recursion_depth;
286
 
set @@max_sp_recursion_depth=0;
287
 
select @@max_sp_recursion_depth;
288
 
set sql_auto_is_null=1;
289
 
select @@sql_auto_is_null;
290
 
set @@sql_auto_is_null=0;
291
 
select @@sql_auto_is_null;
292
212
set sql_big_selects=1;
293
 
set sql_big_tables=1;
294
213
set sql_buffer_result=1;
295
 
set sql_log_bin=1;
296
 
set sql_log_off=1;
297
 
set sql_log_update=1;
298
 
set sql_low_priority_updates=1;
299
 
set sql_max_join_size=200;
300
 
select @@sql_max_join_size,@@max_join_size;
301
 
set sql_quote_show_create=1;
302
214
set sql_safe_updates=1;
303
215
set sql_select_limit=1;
304
216
# reset it, so later tests don't get confused
306
218
set sql_warnings=1;
307
219
set global table_open_cache=100;
308
220
set storage_engine=myisam;
309
 
set global thread_cache_size=100;
310
221
set timestamp=1, timestamp=default;
311
222
set tmp_table_size=100;
312
223
set tx_isolation="READ-COMMITTED";
313
224
set wait_timeout=100;
314
 
set log_warnings=1;
315
 
set global log_warnings=1;
316
 
 
317
 
#
318
 
# Bugs: #20392: INSERT_ID session variable has weird value
319
 
#
320
 
select @@session.insert_id;
321
 
set @save_insert_id=@@session.insert_id;
322
 
set session insert_id=20;
323
 
select @@session.insert_id;
324
 
 
325
 
set session last_insert_id=100;
326
 
select @@session.insert_id;
327
 
select @@session.last_insert_id;
328
 
select @@session.insert_id;
329
 
 
330
 
set @@session.insert_id=@save_insert_id;
331
 
select @@session.insert_id;
332
225
 
333
226
#
334
227
# key buffer
357
250
--error 1238
358
251
select @@session.key_buffer_size;
359
252
 
360
 
--error 1229
361
 
set init_connect = NULL;
362
 
set global init_connect = NULL;
 
253
# init_connect was removed
 
254
#--error 1229
 
255
#set init_connect = NULL;
 
256
#set global init_connect = NULL;
363
257
 
364
258
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
365
259
# expected: check that there is no overflow when 64-bit
372
266
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
373
267
set global myisam_max_sort_file_size=default;
374
268
 
375
 
#
376
 
# swap
377
 
#
378
 
select @@global.max_user_connections,@@local.max_join_size;
379
 
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
380
 
select @@global.max_user_connections,@@local.max_join_size;
381
 
set @@global.max_user_connections=111,@@local.max_join_size=222;
382
 
select @@global.max_user_connections,@@local.max_join_size;
383
 
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
384
 
select @@global.max_user_connections,@@local.max_join_size;
385
 
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
386
 
select @@global.max_user_connections,@@local.max_join_size;
387
 
set @a=1, @b=2;
388
 
set @a=@b, @b=@a;
389
 
select @a, @b;
 
269
## Bug #311084
 
270
## swap
 
271
##
 
272
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
273
#set @svc=@@global.myisam_max_sort_file_size, @svj=@@local.max_join_size;
 
274
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
275
#set @@global.myisam_max_sort_file_size=111,@@local.max_join_size=222;
 
276
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
277
#set @@global.myisam_max_sort_file_size=@@local.max_join_size,@@local.max_join_size=@@global.myisam_max_sort_file_size;
 
278
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
279
#set @@global.myisam_max_sort_file_size=@svc, @@local.max_join_size=@svj;
 
280
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
281
#set @a=1, @b=2;
 
282
#set @a=@b, @b=@a;
 
283
#select @a, @b;
390
284
 
391
285
#
392
286
# Bug#2586:Disallow global/session/local as structured var. instance names
402
296
--error 1064
403
297
SELECT @@global.local.key_buffer_size;
404
298
 
405
 
# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)
406
 
set @tstlw = @@log_warnings;
407
 
show global variables like 'log_warnings';
408
 
select * from information_schema.global_variables where variable_name like 'log_warnings';
409
 
set global log_warnings = 0;
410
 
show global variables like 'log_warnings';
411
 
select * from information_schema.global_variables where variable_name like 'log_warnings';
412
 
set global log_warnings = 42;
413
 
show global variables like 'log_warnings';
414
 
select * from information_schema.global_variables where variable_name like 'log_warnings';
415
 
set global log_warnings = @tstlw;
416
 
show global variables like 'log_warnings';
417
 
select * from information_schema.global_variables where variable_name like 'log_warnings';
418
 
 
419
299
#
420
300
# BUG#4788 show create table provides incorrect statement
421
301
#
423
303
create table t1 (
424
304
  c1 int,
425
305
  c2 int,
426
 
  c3 mediumint,
 
306
  c3 int,
427
307
  c4 int,
428
308
  c5 bigint);
429
309
show create table t1;
435
315
show create table t1;
436
316
drop table t1;
437
317
 
438
 
 
439
 
#
440
 
# Bug #6993: myisam_data_pointer_size
441
 
# Wrong bug report, data pointer size must be restricted to 7,
442
 
# setting to 8 will not work on all computers, myisamchk and
443
 
# the server may see a wrong value, such as 0 or negative number
444
 
# if 8 bytes is set.
445
 
#
446
 
 
447
 
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
448
 
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
449
 
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYISAM_DATA_POINTER_SIZE';
450
 
 
451
318
#
452
319
# Bug #6958: negative arguments to integer options wrap around
453
320
#
458
325
SET GLOBAL table_open_cache=DEFAULT;
459
326
 
460
327
#
461
 
# Bugs12363: character_set_results is nullable,
462
 
# but value_ptr returns string "NULL"
463
 
#
464
 
set character_set_results=NULL;
465
 
select ifnull(@@character_set_results,"really null");
466
 
set names latin1;
467
 
 
468
 
 
469
 
#
470
 
# Bug #9613: @@have_innodb
471
 
#
472
 
 
473
 
--replace_column 1 #
474
 
select @@have_innodb;
475
 
 
476
 
#
477
328
# Tests for lc_time_names
478
329
# Note, when adding new locales, please fix ID accordingly:
479
330
# - to test the last ID (currently 108)
582
433
#
583
434
# Bug #11775 Variable character_set_system does not exist (sometimes)
584
435
#
 
436
--error 1193
585
437
select @@character_set_system;
586
 
--error 1238
587
 
set global character_set_system = latin1;
 
438
--error 1193
 
439
set global character_set_system = utf8;
588
440
--error 1238
589
441
set @@global.version_compile_os='234';
590
442
 
591
443
#
592
 
# Check character_set_filesystem variable
 
444
# Check character_set_filesystem variable invalid for Drizzle
593
445
#
594
 
set character_set_filesystem=latin1;
595
 
select @@character_set_filesystem;
596
 
set @@global.character_set_filesystem=latin2;
597
 
set character_set_filesystem=latin1;
598
 
select @@character_set_filesystem;
599
 
set @@global.character_set_filesystem=latin2;
600
 
set character_set_filesystem=default;
601
 
select @@character_set_filesystem;
602
 
set @@global.character_set_filesystem=default;
603
 
select @@global.character_set_filesystem;
 
446
--error 1193
 
447
set @@global.character_set_filesystem=utf8;
 
448
--error 1193
 
449
set character_set_filesystem=utf8;
604
450
 
605
451
#
606
452
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
608
454
set @old_sql_big_selects = @@sql_big_selects;
609
455
set @@sql_big_selects = 1;
610
456
show variables like 'sql_big_selects';
611
 
select * from information_schema.session_variables where variable_name like 'sql_big_selects';
 
457
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
458
#select * from information_schema.session_variables where variable_name like 'sql_big_selects';
612
459
set @@sql_big_selects = @old_sql_big_selects;
613
460
 
614
461
#
617
464
618
465
set @@sql_notes = 0, @@sql_warnings = 0;
619
466
show variables like 'sql_notes';
620
 
select * from information_schema.session_variables where variable_name like 'sql_notes';
 
467
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
468
#select * from information_schema.session_variables where variable_name like 'sql_notes';
621
469
show variables like 'sql_warnings';
622
 
select * from information_schema.session_variables where variable_name like 'sql_warnings';
 
470
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
471
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
623
472
set @@sql_notes = 1, @@sql_warnings = 1;
624
473
show variables like 'sql_notes';
625
 
select * from information_schema.session_variables where variable_name like 'sql_notes';
 
474
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
475
#select * from information_schema.session_variables where variable_name like 'sql_notes';
626
476
show variables like 'sql_warnings';
627
 
select * from information_schema.session_variables where variable_name like 'sql_warnings';
628
 
 
629
 
#
630
 
# Bug #12792: @@system_time_zone is not SELECTable.
631
 
#
632
 
# Don't actually output, since it depends on the system
633
 
--replace_column 1 #
634
 
select @@system_time_zone;
 
477
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
478
#select * from information_schema.session_variables where variable_name like 'sql_warnings';
635
479
 
636
480
#
637
481
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
651
495
--replace_column 2 #
652
496
show variables like 'basedir';
653
497
--replace_column 2 #
654
 
select * from information_schema.session_variables where variable_name like 'basedir';
 
498
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
499
#select * from information_schema.session_variables where variable_name like 'basedir';
655
500
--replace_column 2 #
656
501
show variables like 'datadir';
657
502
--replace_column 2 #
658
 
select * from information_schema.session_variables where variable_name like 'datadir';
 
503
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
504
#select * from information_schema.session_variables where variable_name like 'datadir';
659
505
--replace_column 2 #
660
506
show variables like 'tmpdir';
661
507
--replace_column 2 #
662
 
select * from information_schema.session_variables where variable_name like 'tmpdir';
 
508
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
509
#select * from information_schema.session_variables where variable_name like 'tmpdir';
663
510
 
664
511
#
665
512
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
666
513
667
514
# Don't actually output, since it depends on the system
668
 
--replace_column 1 # 2 # 3 # 4 # 5 #
669
 
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
670
 
--replace_column 2 #
671
 
show variables like 'ssl%';
672
 
--replace_column 2 #
673
 
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
 
515
#--replace_column 1 # 2 # 3 # 4 # 5 #
 
516
# Not supported in Drizzle
 
517
#select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
 
518
#--replace_column 2 #
 
519
#show variables like 'ssl%';
 
520
#--replace_column 2 #
 
521
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
522
#select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
674
523
 
675
524
#
676
525
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
677
526
# and as @@log_queries_not_using_indexes
678
527
#
679
 
select @@log_queries_not_using_indexes;
680
 
show variables like 'log_queries_not_using_indexes';
681
 
select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
 
528
# Not valid in Drizzle
 
529
#select @@log_queries_not_using_indexes;
 
530
#show variables like 'log_queries_not_using_indexes';
 
531
# Bug 311025 Segmentation fault when accessing INFORMATION_SCHEMA
 
532
#select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
682
533
 
683
534
#
684
535
# Bug#20908: Crash if select @@""
709
560
# Bug #19263: variables.test doesn't clean up after itself (II/II --
710
561
# restore)
711
562
#
712
 
set global binlog_cache_size         =@my_binlog_cache_size;
713
563
set global connect_timeout           =@my_connect_timeout;
714
564
set global flush                     =@my_flush;
 
565
--error 1193
715
566
set global flush_time                =@my_flush_time;
716
567
set global key_buffer_size           =@my_key_buffer_size;
717
 
set global max_binlog_cache_size     =default;                #@my_max_binlog_cache_size;
718
 
set global max_binlog_size           =@my_max_binlog_size;
719
568
set global max_connect_errors        =@my_max_connect_errors;
720
 
set global max_connections           =@my_max_connections;
721
569
set global max_heap_table_size       =@my_max_heap_table_size;
722
570
set global max_join_size             =@my_max_join_size;
723
571
# No default
724
572
#set global max_user_connections      =default;
725
573
set global max_write_lock_count      =default;
 
574
--error 1232
726
575
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
727
576
set global net_buffer_length         =@my_net_buffer_length;
728
577
set global net_write_timeout         =@my_net_write_timeout;
729
578
set global net_read_timeout          =@my_net_read_timeout;
730
 
set global rpl_recovery_rank         =@my_rpl_recovery_rank;
731
579
set global server_id                 =@my_server_id;
732
 
set global slow_launch_time          =@my_slow_launch_time;
733
580
set global storage_engine            =@my_storage_engine;
 
581
--error 1193
734
582
set global thread_cache_size         =@my_thread_cache_size;
735
583
 
736
584
#
737
585
# Bug#28580 Repeatation of status variables
738
586
#
739
587
--replace_column 2 #
740
 
show global variables where Variable_name='table_definition_cache' or
741
 
Variable_name='table_lock_wait_timeout';
742
 
 
743
 
###########################################################################
744
 
 
745
 
--echo
746
 
--echo # --
747
 
--echo # -- Bug#34820: log_output can be set to illegal value.
748
 
--echo # --
749
 
 
750
 
--error ER_WRONG_VALUE_FOR_VAR
751
 
SET GLOBAL log_output = '';
752
 
 
753
 
--error ER_WRONG_VALUE_FOR_VAR
754
 
SET GLOBAL log_output = 0;
755
 
 
756
 
--echo
757
 
--echo # -- End of Bug#34820.
758
 
 
 
588
# Drizzle Bug 311044
 
589
#show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';