~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

  • Committer: Monty Taylor
  • Date: 2008-11-16 06:29:53 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116062953-ivdltjmfe009b5fr
Moved stuff into item/

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
set @my_connect_timeout           =@@global.connect_timeout;
 
13
set @my_flush                     =@@global.flush;
 
14
set @my_flush_time                =@@global.flush_time;
 
15
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;
11
18
set @my_max_connect_errors        =@@global.max_connect_errors;
 
19
set @my_max_connections           =@@global.max_connections;
12
20
set @my_max_heap_table_size       =@@global.max_heap_table_size;
13
21
set @my_max_join_size             =@@global.max_join_size;
14
 
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
 
22
set @my_myisam_data_pointer_size  =@@global.myisam_data_pointer_size;
 
23
set @my_net_buffer_length         =@@global.net_buffer_length;
 
24
set @my_net_write_timeout         =@@global.net_write_timeout;
 
25
set @my_net_read_timeout          =@@global.net_read_timeout;
 
26
set @my_rpl_recovery_rank         =@@global.rpl_recovery_rank;
15
27
set @my_server_id                 =@@global.server_id;
 
28
set @my_slow_launch_time          =@@global.slow_launch_time;
16
29
set @my_storage_engine            =@@global.storage_engine;
17
 
set @my_myisam_sort_buffer_size   =@@global.myisam_sort_buffer_size;
18
 
set @my_tx_isolation      =@@global.tx_isolation;
 
30
set @my_thread_cache_size         =@@global.thread_cache_size;
19
31
 
20
32
# case insensitivity tests (new in 5.0)
21
33
set @`test`=1;
49
61
# Test problem with WHERE and variables
50
62
#
51
63
 
52
 
CREATE TABLE t1 (c_id INT NOT NULL, c_name VARCHAR(250), c_country VARCHAR(250), PRIMARY KEY(c_id));
 
64
CREATE TABLE t1 (c_id INT(4) NOT NULL, c_name CHAR(20), c_country CHAR(3), PRIMARY KEY(c_id));
53
65
INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB');
54
66
SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1;
55
67
SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid;
64
76
set GLOBAL max_join_size=10;
65
77
set max_join_size=100;
66
78
show variables like 'max_join_size';
67
 
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';
68
80
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
69
81
show global variables like 'max_join_size';
70
82
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
71
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
83
select * from information_schema.global_variables where variable_name like 'max_join_size';
72
84
set GLOBAL max_join_size=2000;
73
85
show global variables like 'max_join_size';
74
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
86
select * from information_schema.global_variables where variable_name like 'max_join_size';
75
87
set max_join_size=DEFAULT;
76
88
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
77
89
show variables like 'max_join_size';
78
90
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
79
 
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
 
91
select * from information_schema.session_variables where variable_name like 'max_join_size';
80
92
set GLOBAL max_join_size=DEFAULT;
81
93
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
82
94
show global variables like 'max_join_size';
83
95
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
84
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
96
select * from information_schema.global_variables where variable_name like 'max_join_size';
85
97
set @@max_join_size=1000, @@global.max_join_size=2000;
86
98
select @@local.max_join_size, @@global.max_join_size;
87
99
select @@identity,  length(@@version)>0;
91
103
select @@IDENTITY,last_insert_id(), @@identity;
92
104
explain extended select @@IDENTITY,last_insert_id(), @@identity;
93
105
 
 
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
 
94
120
set global timed_mutexes=ON;
95
121
show variables like 'timed_mutexes';
96
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
122
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
97
123
set global timed_mutexes=0;
98
124
show variables like 'timed_mutexes';
99
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
125
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
100
126
 
101
 
set storage_engine=MYISAM, storage_engine="MEMORY";
 
127
set storage_engine=MYISAM, storage_engine="HEAP";
102
128
show local variables like 'storage_engine';
103
 
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
 
129
select * from information_schema.session_variables where variable_name like 'storage_engine';
104
130
show global variables like 'storage_engine';
105
 
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
 
131
select * from information_schema.global_variables where variable_name like 'storage_engine';
106
132
 
107
133
set GLOBAL myisam_max_sort_file_size=2000000;
108
134
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';
 
135
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
110
136
set GLOBAL myisam_max_sort_file_size=default;
111
137
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
112
138
show global variables like 'myisam_max_sort_file_size';
113
139
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
 
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
 
140
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
115
141
 
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';
 
142
set global net_retry_count=10, session net_retry_count=10;
 
143
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
 
144
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
 
145
show global variables like 'net_%';
 
146
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
147
show session variables like 'net_%';
 
148
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
149
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
 
150
show global variables like 'net_%';
 
151
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
152
show session variables like 'net_%';
 
153
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
154
set net_buffer_length=1;
 
155
show variables like 'net_buffer_length';
 
156
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
123
157
#warning 1292
124
 
set global mysql_protocol_buffer_length=2000000000;
125
 
show variables like 'mysql_protocol_buffer_length';
 
158
set net_buffer_length=2000000000;
 
159
show variables like 'net_buffer_length';
 
160
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
 
161
 
 
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);
126
169
 
127
170
show variables like '%alloc%';
128
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
171
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
129
172
set @@range_alloc_block_size=1024*16;
130
173
set @@query_alloc_block_size=1024*17+2;
131
174
set @@query_prealloc_size=1024*18;
 
175
set @@transaction_alloc_block_size=1024*20-1;
 
176
set @@transaction_prealloc_size=1024*21-1;
132
177
select @@query_alloc_block_size;
133
178
show variables like '%alloc%';
134
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
179
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
135
180
set @@range_alloc_block_size=default;
136
181
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
 
182
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
137
183
show variables like '%alloc%';
138
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
184
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
139
185
 
140
186
#
141
187
# Bug #10904 Illegal mix of collations between
146
192
 
147
193
# The following should give errors
148
194
 
149
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
195
--error 1231
 
196
set big_tables=OFFF;
 
197
--error 1231
 
198
set big_tables="OFFF";
 
199
--error 1193
150
200
set unknown_variable=1;
151
 
--error ER_WRONG_TYPE_FOR_VAR
 
201
--error 1232
152
202
set max_join_size="hello";
153
 
--error ER_UNKNOWN_STORAGE_ENGINE
 
203
--error 1286
154
204
set storage_engine=UNKNOWN_TABLE_TYPE;
155
 
--error ER_NO_DEFAULT
 
205
--error 1230
156
206
set GLOBAL storage_engine=DEFAULT;
157
 
--error ER_LOCAL_VARIABLE
 
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
--error 1228
158
216
set global autocommit=1;
159
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
217
--error 1238
160
218
select @@global.timestamp;
161
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR 
 
219
--error 1238 
162
220
set @@version='';
163
 
--error ER_GLOBAL_VARIABLE
 
221
--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
164
228
set myisam_max_sort_file_size=100;
165
 
--error ER_WRONG_VALUE_FOR_VAR
 
229
--error 1231
166
230
set @@SQL_WARNINGS=NULL;
167
231
 
168
232
# Test setting all variables
169
233
 
170
234
set autocommit=1;
171
 
select @@autocommit;
 
235
set big_tables=1;
 
236
select @@autocommit, @@big_tables;
 
237
set global binlog_cache_size=100;
172
238
set bulk_insert_buffer_size=100;
 
239
set character set cp1251_koi8;
 
240
set character set default;
 
241
set @@global.concurrent_insert=1;
 
242
set global connect_timeout=100;
 
243
select @@delay_key_write;
 
244
set global delay_key_write="OFF";
 
245
select @@delay_key_write;
 
246
set global delay_key_write=ALL;
 
247
select @@delay_key_write;
 
248
set global delay_key_write=1;
 
249
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;
173
254
set join_buffer_size=100;
174
255
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;
175
262
set max_allowed_packet=100;
 
263
set global max_binlog_cache_size=100;
 
264
set global max_binlog_size=100;
176
265
set global max_connect_errors=100;
 
266
set global max_connections=100;
177
267
set max_heap_table_size=100;
178
268
set max_join_size=100;
179
269
set max_sort_length=100;
 
270
set max_tmp_tables=100;
 
271
set global max_user_connections=100;
 
272
select @@max_user_connections;
180
273
set global max_write_lock_count=100;
181
 
set global myisam_sort_buffer_size=100;
182
 
set global mysql_protocol_buffer_length=100;
 
274
set myisam_sort_buffer_size=100;
 
275
set net_buffer_length=100;
 
276
set net_read_timeout=100;
 
277
set net_write_timeout=100;
183
278
set read_buffer_size=100;
184
279
set read_rnd_buffer_size=100;
 
280
set global rpl_recovery_rank=100;
185
281
set global server_id=100;
 
282
set global slow_launch_time=100;
186
283
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;
187
292
set sql_big_selects=1;
 
293
set sql_big_tables=1;
188
294
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
set sql_safe_updates=1;
189
303
set sql_select_limit=1;
190
304
# reset it, so later tests don't get confused
191
305
set sql_select_limit=default;
192
306
set sql_warnings=1;
193
307
set global table_open_cache=100;
194
308
set storage_engine=myisam;
 
309
set global thread_cache_size=100;
195
310
set timestamp=1, timestamp=default;
196
311
set tmp_table_size=100;
197
312
set tx_isolation="READ-COMMITTED";
 
313
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
 
 
333
#
 
334
# key buffer
 
335
#
 
336
 
 
337
create table t1 (a int not null auto_increment, primary key(a));
 
338
create table t2 (a int not null auto_increment, primary key(a));
 
339
insert into t1 values(null),(null),(null);
 
340
insert into t2 values(null),(null),(null);
 
341
set global key_buffer_size=100000;
 
342
select @@key_buffer_size;
 
343
select * from t1 where a=2;
 
344
select * from t2 where a=3;
 
345
check table t1,t2;
 
346
select max(a) +1, max(a) +2 into @xx,@yy from t1;
 
347
drop table t1,t2;
 
348
 
 
349
#
 
350
# error conditions
 
351
#
 
352
 
 
353
--error 1193
 
354
select @@xxxxxxxxxx;
 
355
select 1;
 
356
 
 
357
--error 1238
 
358
select @@session.key_buffer_size;
 
359
 
 
360
--error 1229
 
361
set init_connect = NULL;
 
362
set global init_connect = NULL;
198
363
 
199
364
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
200
365
# expected: check that there is no overflow when 64-bit
204
369
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
205
370
show global variables like 'myisam_max_sort_file_size';
206
371
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
207
 
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
 
372
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
208
373
set global myisam_max_sort_file_size=default;
209
374
 
210
 
## Bug #311084
211
 
## swap
212
 
##
213
 
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
214
 
#set @svc=@@global.myisam_max_sort_file_size, @svj=@@local.max_join_size;
215
 
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
216
 
#set @@global.myisam_max_sort_file_size=111,@@local.max_join_size=222;
217
 
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
218
 
#set @@global.myisam_max_sort_file_size=@@local.max_join_size,@@local.max_join_size=@@global.myisam_max_sort_file_size;
219
 
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
220
 
#set @@global.myisam_max_sort_file_size=@svc, @@local.max_join_size=@svj;
221
 
#select @@global.myisam_max_sort_file_size,@@local.max_join_size;
222
 
#set @a=1, @b=2;
223
 
#set @a=@b, @b=@a;
224
 
#select @a, @b;
 
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;
 
390
 
 
391
#
 
392
# Bug#2586:Disallow global/session/local as structured var. instance names
 
393
#
 
394
--error 1064
 
395
set @@global.global.key_buffer_size= 1;
 
396
--error 1064
 
397
set GLOBAL global.key_buffer_size= 1;
 
398
--error 1064
 
399
SELECT @@global.global.key_buffer_size;
 
400
--error 1064
 
401
SELECT @@global.session.key_buffer_size;
 
402
--error 1064
 
403
SELECT @@global.local.key_buffer_size;
 
404
 
 
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';
225
418
 
226
419
#
227
420
# BUG#4788 show create table provides incorrect statement
228
421
#
229
422
# What default width have numeric types?
230
 
create temporary table t1 (
 
423
create table t1 (
231
424
  c1 int,
232
425
  c2 int,
233
 
  c3 int,
 
426
  c3 mediumint,
234
427
  c4 int,
235
428
  c5 bigint);
236
429
show create table t1;
238
431
#
239
432
# What types and widths have variables?
240
433
set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0;
241
 
create temporary table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
 
434
create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
242
435
show create table t1;
243
436
drop table t1;
244
437
 
 
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
 
245
451
#
246
452
# Bug #6958: negative arguments to integer options wrap around
247
453
#
248
454
 
249
455
SET GLOBAL table_open_cache=-1;
250
456
SHOW VARIABLES LIKE 'table_open_cache';
251
 
SELECT * FROM DATA_DICTIONARY.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
 
457
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
252
458
SET GLOBAL table_open_cache=DEFAULT;
253
459
 
254
460
#
 
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
#
255
477
# Tests for lc_time_names
256
478
# Note, when adding new locales, please fix ID accordingly:
257
479
# - to test the last ID (currently 108)
268
490
--echo *** LC_TIME_NAMES: testing with string expressions
269
491
set lc_time_names=concat('de','_','DE');
270
492
select @@lc_time_names;
271
 
--error ER_UNKNOWN_ERROR
 
493
--error 1105
272
494
set lc_time_names=concat('de','+','DE');
273
495
select @@lc_time_names;
274
496
--echo LC_TIME_NAMES: testing with numeric expressions
275
497
set @@lc_time_names=1+2;
276
498
select @@lc_time_names;
277
 
--error ER_WRONG_TYPE_FOR_VAR
 
499
--error 1232
278
500
set @@lc_time_names=1/0;
279
501
select @@lc_time_names;
280
502
set lc_time_names=en_US;
281
503
--echo LC_TIME_NAMES: testing NULL and a negative number:
282
 
--error ER_WRONG_VALUE_FOR_VAR
 
504
--error 1231
283
505
set lc_time_names=NULL;
284
 
--error ER_UNKNOWN_ERROR
 
506
--error 1105
285
507
set lc_time_names=-1;
286
508
select @@lc_time_names;
287
509
--echo LC_TIME_NAMES: testing locale with the last ID:
288
510
set lc_time_names=108;
289
511
select @@lc_time_names;
290
512
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
291
 
--error ER_UNKNOWN_ERROR
 
513
--error 1105
292
514
set lc_time_names=109;
293
515
select @@lc_time_names;
294
516
--echo LC_TIME_NAMES: testing that 0 is en_US:
332
554
# Bug#6282 Packet error with SELECT INTO
333
555
334
556
 
335
 
create temporary table t1 (a int);
 
557
create table t1 (a int);
336
558
select a into @x from t1;
337
559
show warnings;
338
560
drop table t1;
341
563
# Bug #10339: read only variables.
342
564
#
343
565
 
344
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
566
--error 1238
345
567
set @@warning_count=1;
346
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
568
--error 1238
347
569
set @@global.error_count=1;
348
570
 
349
571
#
350
572
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
351
573
#
352
 
--disable_query_log
353
 
select VARIABLE_VALUE from data_dictionary.GLOBAL_VARIABLES where VARIABLE_NAME like "VERSION_COMPILE_MACHINE" into @arch;
354
 
--enable_query_log
355
 
# We technically do not care about 32bit hardware. -Brian
356
 
#set @@max_heap_table_size= 4294967296;
357
 
#select @@max_heap_table_size > 0;
358
 
#set global max_heap_table_size= 4294967296;
359
 
#select @@max_heap_table_size > 0;
360
 
#set @@max_heap_table_size= 4294967296;
361
 
#select @@max_heap_table_size > 0;
362
 
--enable_warnings
 
574
 
 
575
set @@max_heap_table_size= 4294967296;
 
576
select @@max_heap_table_size > 0;
 
577
set global max_heap_table_size= 4294967296;
 
578
select @@max_heap_table_size > 0;
 
579
set @@max_heap_table_size= 4294967296;
 
580
select @@max_heap_table_size > 0;
 
581
 
363
582
#
364
583
# Bug #11775 Variable character_set_system does not exist (sometimes)
365
584
#
366
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
367
585
select @@character_set_system;
368
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
369
 
set global character_set_system = utf8;
370
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
586
--error 1238
 
587
set global character_set_system = latin1;
 
588
--error 1238
371
589
set @@global.version_compile_os='234';
372
590
 
373
591
#
374
 
# Check character_set_filesystem variable invalid for Drizzle
 
592
# Check character_set_filesystem variable
375
593
#
376
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
377
 
set @@global.character_set_filesystem=utf8;
378
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
379
 
set character_set_filesystem=utf8;
 
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;
380
604
 
381
605
#
382
606
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
383
607
#
384
 
set @sql_big_selects = @@sql_big_selects;
 
608
set @old_sql_big_selects = @@sql_big_selects;
385
609
set @@sql_big_selects = 1;
386
610
show variables like 'sql_big_selects';
387
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
388
 
#select * from data_dictionary.session_variables where variable_name like 'sql_big_selects';
389
 
set @@sql_big_selects = @sql_big_selects;
 
611
select * from information_schema.session_variables where variable_name like 'sql_big_selects';
 
612
set @@sql_big_selects = @old_sql_big_selects;
390
613
 
391
614
#
392
615
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
394
617
395
618
set @@sql_notes = 0, @@sql_warnings = 0;
396
619
show variables like 'sql_notes';
397
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
398
 
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
 
620
select * from information_schema.session_variables where variable_name like 'sql_notes';
399
621
show variables like 'sql_warnings';
400
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
401
 
#select * from data_dictionary.session_variables where variable_name like 'sql_warnings';
 
622
select * from information_schema.session_variables where variable_name like 'sql_warnings';
402
623
set @@sql_notes = 1, @@sql_warnings = 1;
403
624
show variables like 'sql_notes';
404
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
405
 
#select * from data_dictionary.session_variables where variable_name like 'sql_notes';
 
625
select * from information_schema.session_variables where variable_name like 'sql_notes';
406
626
show variables like 'sql_warnings';
407
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
408
 
#select * from data_dictionary.session_variables where variable_name 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;
409
635
 
410
636
#
411
637
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
425
651
--replace_column 2 #
426
652
show variables like 'basedir';
427
653
--replace_column 2 #
428
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
429
 
#select * from data_dictionary.session_variables where variable_name like 'basedir';
 
654
select * from information_schema.session_variables where variable_name like 'basedir';
430
655
--replace_column 2 #
431
656
show variables like 'datadir';
432
657
--replace_column 2 #
433
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
434
 
#select * from data_dictionary.session_variables where variable_name like 'datadir';
 
658
select * from information_schema.session_variables where variable_name like 'datadir';
435
659
--replace_column 2 #
436
660
show variables like 'tmpdir';
437
661
--replace_column 2 #
 
662
select * from information_schema.session_variables where variable_name like 'tmpdir';
 
663
 
 
664
#
 
665
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
 
666
 
667
# 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;
 
674
 
 
675
#
 
676
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
 
677
# and as @@log_queries_not_using_indexes
 
678
#
 
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';
438
682
 
439
683
#
440
684
# Bug#20908: Crash if select @@""
452
696
# Don't actually output, since it depends on the system
453
697
--replace_column 1 #
454
698
select @@hostname;
455
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
699
--error 1238
456
700
set @@hostname= "anothername";
457
701
--replace_column 2 #
458
702
show variables like 'hostname';
465
709
# Bug #19263: variables.test doesn't clean up after itself (II/II --
466
710
# restore)
467
711
#
468
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
712
set global binlog_cache_size         =@my_binlog_cache_size;
 
713
set global connect_timeout           =@my_connect_timeout;
 
714
set global flush                     =@my_flush;
469
715
set global flush_time                =@my_flush_time;
 
716
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;
470
719
set global max_connect_errors        =@my_max_connect_errors;
 
720
set global max_connections           =@my_max_connections;
471
721
set global max_heap_table_size       =@my_max_heap_table_size;
472
722
set global max_join_size             =@my_max_join_size;
473
723
# No default
 
724
#set global max_user_connections      =default;
474
725
set global max_write_lock_count      =default;
475
 
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
 
726
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
 
727
set global net_buffer_length         =@my_net_buffer_length;
 
728
set global net_write_timeout         =@my_net_write_timeout;
 
729
set global net_read_timeout          =@my_net_read_timeout;
 
730
set global rpl_recovery_rank         =@my_rpl_recovery_rank;
476
731
set global server_id                 =@my_server_id;
 
732
set global slow_launch_time          =@my_slow_launch_time;
477
733
set global storage_engine            =@my_storage_engine;
478
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
479
734
set global thread_cache_size         =@my_thread_cache_size;
480
 
set global myisam_sort_buffer_size   =@my_myisam_sort_buffer_size;
481
 
 
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
735
 
521
736
#
522
737
# Bug#28580 Repeatation of status variables
523
738
#
524
 
 
525
739
--replace_column 2 #
526
 
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
 
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.
527
758