~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

  • Committer: Jay Pipes
  • Date: 2010-03-09 20:02:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1339.
  • Revision ID: jpipes@serialcoder-20100309200229-dfrliy4fads9vyf4
Fixes Bug #535296 by only incrementing ha_commit_count when its a normal transaction commit.

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
 
8
9
#
9
10
# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
10
11
#
 
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;
18
20
 
19
21
# case insensitivity tests (new in 5.0)
20
22
set @`test`=1;
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';
114
116
 
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';
122
124
#warning 1292
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';
125
127
 
126
128
show variables like '%alloc%';
127
129
select * from data_dictionary.session_variables where variable_name like '%alloc%';
145
147
 
146
148
# The following should give errors
147
149
 
148
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
150
--error 1193
149
151
set unknown_variable=1;
150
 
--error ER_WRONG_TYPE_FOR_VAR
 
152
--error 1232
151
153
set max_join_size="hello";
152
 
--error ER_UNKNOWN_STORAGE_ENGINE
 
154
--error 1286
153
155
set storage_engine=UNKNOWN_TABLE_TYPE;
154
 
--error ER_NO_DEFAULT
 
156
--error 1230
155
157
set GLOBAL storage_engine=DEFAULT;
156
 
--error ER_LOCAL_VARIABLE
 
158
--error 1228
157
159
set global autocommit=1;
158
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
160
--error 1238
159
161
select @@global.timestamp;
160
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR 
 
162
--error 1238 
161
163
set @@version='';
162
 
--error ER_GLOBAL_VARIABLE
 
164
--error 1229
163
165
set myisam_max_sort_file_size=100;
164
 
--error ER_WRONG_VALUE_FOR_VAR
 
166
--error 1231
165
167
set @@SQL_WARNINGS=NULL;
166
168
 
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";
196
199
 
 
200
#
 
201
# key buffer
 
202
#
 
203
 
 
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;
 
212
check table t1,t2;
 
213
select max(a) +1, max(a) +2 into @xx,@yy from t1;
 
214
drop table t1,t2;
 
215
 
 
216
#
 
217
# error conditions
 
218
#
 
219
 
 
220
--error 1193
 
221
select @@xxxxxxxxxx;
 
222
select 1;
 
223
 
 
224
--error 1238
 
225
select @@session.myisam_key_cache_size;
 
226
 
 
227
# init_connect was removed
 
228
#--error 1229
 
229
#set init_connect = NULL;
 
230
#set global init_connect = NULL;
 
231
 
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
222
257
#select @a, @b;
223
258
 
224
259
#
 
260
# Bug#2586:Disallow global/session/local as structured var. instance names
 
261
#
 
262
--error 1193
 
263
set @@global.global.myisam_key_cache_size= 1;
 
264
--error 1193
 
265
set GLOBAL global.myisam_key_cache_size= 1;
 
266
--error 1064
 
267
SELECT @@global.global.myisam_key_cache_size;
 
268
--error 1064
 
269
SELECT @@global.session.myisam_key_cache_size;
 
270
--error 1064
 
271
SELECT @@global.local.myisam_key_cache_size;
 
272
 
 
273
#
225
274
# BUG#4788 show create table provides incorrect statement
226
275
#
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
 
318
--error 1105
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
 
324
--error 1232
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
 
329
--error 1231
281
330
set lc_time_names=NULL;
282
 
--error ER_UNKNOWN_ERROR
 
331
--error 1105
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
 
338
--error 1105
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:
339
388
# Bug #10339: read only variables.
340
389
#
341
390
 
342
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
391
--error 1238
343
392
set @@warning_count=1;
344
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
393
--error 1238
345
394
set @@global.error_count=1;
346
395
 
347
396
#
361
410
#
362
411
# Bug #11775 Variable character_set_system does not exist (sometimes)
363
412
#
364
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
413
--error 1193
365
414
select @@character_set_system;
366
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
415
--error 1193
367
416
set global character_set_system = utf8;
368
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
417
--error 1238
369
418
set @@global.version_compile_os='234';
370
419
 
371
420
#
372
421
# Check character_set_filesystem variable invalid for Drizzle
373
422
#
374
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
423
--error 1193
375
424
set @@global.character_set_filesystem=utf8;
376
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
425
--error 1193
377
426
set character_set_filesystem=utf8;
378
427
 
379
428
#
450
499
# Don't actually output, since it depends on the system
451
500
--replace_column 1 #
452
501
select @@hostname;
453
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
502
--error 1238
454
503
set @@hostname= "anothername";
455
504
--replace_column 2 #
456
505
show variables like 'hostname';
463
512
# Bug #19263: variables.test doesn't clean up after itself (II/II --
464
513
# restore)
465
514
#
466
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
515
--error 1193
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;
470
521
# No default
471
522
set global max_write_lock_count      =default;
472
 
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
 
523
--error 1232
 
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
 
528
--error 1193
476
529
set global thread_cache_size         =@my_thread_cache_size;
477
530
set global myisam_sort_buffer_size   =@my_myisam_sort_buffer_size;
478
531
 
479
 
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
480
 
SHOW LOCAL VARIABLES LIKE 'max_join_size';
481
 
 
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;
499
 
 
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;
516
 
 
517
532
#
518
533
# Bug#28580 Repeatation of status variables
519
534
#
520
 
 
521
535
--replace_column 2 #
522
536
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
523