~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/variables.test

Tags: innodb-plugin-1.0.3
InnoDB Plugin 1.0.3

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_key_buffer_size           =@@global.key_buffer_size;
 
15
set @my_max_binlog_cache_size     =@@global.max_binlog_cache_size;
 
16
set @my_max_binlog_size           =@@global.max_binlog_size;
11
17
set @my_max_connect_errors        =@@global.max_connect_errors;
 
18
set @my_max_connections           =@@global.max_connections;
12
19
set @my_max_heap_table_size       =@@global.max_heap_table_size;
13
20
set @my_max_join_size             =@@global.max_join_size;
14
 
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
 
21
set @my_net_buffer_length         =@@global.net_buffer_length;
 
22
set @my_net_write_timeout         =@@global.net_write_timeout;
 
23
set @my_net_read_timeout          =@@global.net_read_timeout;
15
24
set @my_server_id                 =@@global.server_id;
 
25
set @my_slow_launch_time          =@@global.slow_launch_time;
16
26
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;
 
27
set @my_thread_cache_size         =@@global.thread_cache_size;
19
28
 
20
29
# case insensitivity tests (new in 5.0)
21
30
set @`test`=1;
64
73
set GLOBAL max_join_size=10;
65
74
set max_join_size=100;
66
75
show variables like 'max_join_size';
67
 
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
 
76
select * from information_schema.session_variables where variable_name like 'max_join_size';
68
77
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
69
78
show global variables like 'max_join_size';
70
79
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
71
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
80
select * from information_schema.global_variables where variable_name like 'max_join_size';
72
81
set GLOBAL max_join_size=2000;
73
82
show global variables like 'max_join_size';
74
 
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';
75
84
set max_join_size=DEFAULT;
76
85
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
77
86
show variables like 'max_join_size';
78
87
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
79
 
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
 
88
select * from information_schema.session_variables where variable_name like 'max_join_size';
80
89
set GLOBAL max_join_size=DEFAULT;
81
90
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
82
91
show global variables like 'max_join_size';
83
92
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
84
 
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
 
93
select * from information_schema.global_variables where variable_name like 'max_join_size';
85
94
set @@max_join_size=1000, @@global.max_join_size=2000;
86
95
select @@local.max_join_size, @@global.max_join_size;
87
96
select @@identity,  length(@@version)>0;
93
102
 
94
103
set global timed_mutexes=ON;
95
104
show variables like 'timed_mutexes';
96
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
105
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
97
106
set global timed_mutexes=0;
98
107
show variables like 'timed_mutexes';
99
 
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
 
108
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
100
109
 
101
 
set storage_engine=MYISAM, storage_engine="MEMORY";
 
110
set storage_engine=MYISAM, storage_engine="HEAP";
102
111
show local variables like 'storage_engine';
103
 
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
 
112
select * from information_schema.session_variables where variable_name like 'storage_engine';
104
113
show global variables like 'storage_engine';
105
 
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
 
114
select * from information_schema.global_variables where variable_name like 'storage_engine';
106
115
 
107
116
set GLOBAL myisam_max_sort_file_size=2000000;
108
117
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';
 
118
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
110
119
set GLOBAL myisam_max_sort_file_size=default;
111
120
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
112
121
show global variables like 'myisam_max_sort_file_size';
113
122
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
114
 
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
 
123
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
115
124
 
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';
 
125
set global net_retry_count=10, session net_retry_count=10;
 
126
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
 
127
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
 
128
show global variables like 'net_%';
 
129
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
130
show session variables like 'net_%';
 
131
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
132
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
 
133
show global variables like 'net_%';
 
134
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
 
135
show session variables like 'net_%';
 
136
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
 
137
set net_buffer_length=1;
 
138
show variables like 'net_buffer_length';
 
139
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
123
140
#warning 1292
124
 
set global mysql_protocol_buffer_length=2000000000;
125
 
show variables like 'mysql_protocol_buffer_length';
 
141
set net_buffer_length=2000000000;
 
142
show variables like 'net_buffer_length';
 
143
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
126
144
 
127
145
show variables like '%alloc%';
128
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
146
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
129
147
set @@range_alloc_block_size=1024*16;
130
148
set @@query_alloc_block_size=1024*17+2;
131
149
set @@query_prealloc_size=1024*18;
 
150
set @@transaction_alloc_block_size=1024*20-1;
 
151
set @@transaction_prealloc_size=1024*21-1;
132
152
select @@query_alloc_block_size;
133
153
show variables like '%alloc%';
134
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
154
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
135
155
set @@range_alloc_block_size=default;
136
156
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
 
157
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
137
158
show variables like '%alloc%';
138
 
select * from data_dictionary.session_variables where variable_name like '%alloc%';
 
159
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
139
160
 
140
161
#
141
162
# Bug #10904 Illegal mix of collations between
146
167
 
147
168
# The following should give errors
148
169
 
149
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
170
--error 1193
150
171
set unknown_variable=1;
151
 
--error ER_WRONG_TYPE_FOR_VAR
 
172
--error 1232
152
173
set max_join_size="hello";
153
 
--error ER_UNKNOWN_STORAGE_ENGINE
 
174
--error 1286
154
175
set storage_engine=UNKNOWN_TABLE_TYPE;
155
 
--error ER_NO_DEFAULT
 
176
--error 1230
156
177
set GLOBAL storage_engine=DEFAULT;
157
 
--error ER_LOCAL_VARIABLE
 
178
--error 1273
 
179
set collation_connection=UNKNOWN_COLLATION;
 
180
--error 1231
 
181
set collation_connection=NULL;
 
182
--error 1228
158
183
set global autocommit=1;
159
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
184
--error 1238
160
185
select @@global.timestamp;
161
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR 
 
186
--error 1238 
162
187
set @@version='';
163
 
--error ER_GLOBAL_VARIABLE
 
188
--error 1229
164
189
set myisam_max_sort_file_size=100;
165
 
--error ER_WRONG_VALUE_FOR_VAR
 
190
--error 1231
166
191
set @@SQL_WARNINGS=NULL;
167
192
 
168
193
# Test setting all variables
169
194
 
170
195
set autocommit=1;
171
196
select @@autocommit;
 
197
set global binlog_cache_size=100;
172
198
set bulk_insert_buffer_size=100;
 
199
set global connect_timeout=100;
 
200
select @@delay_key_write;
 
201
set global delay_key_write="OFF";
 
202
select @@delay_key_write;
 
203
set global delay_key_write=ALL;
 
204
set global delay_key_write=1;
 
205
select @@delay_key_write;
 
206
set insert_id=1;
 
207
set interactive_timeout=100;
173
208
set join_buffer_size=100;
174
209
set last_insert_id=1;
 
210
set global local_infile=1;
175
211
set max_allowed_packet=100;
 
212
set global max_binlog_cache_size=100;
 
213
set global max_binlog_size=100;
176
214
set global max_connect_errors=100;
 
215
set global max_connections=100;
177
216
set max_heap_table_size=100;
178
217
set max_join_size=100;
179
218
set max_sort_length=100;
 
219
set max_tmp_tables=100;
180
220
set global max_write_lock_count=100;
181
 
set global myisam_sort_buffer_size=100;
182
 
set global mysql_protocol_buffer_length=100;
 
221
set myisam_sort_buffer_size=100;
 
222
set net_buffer_length=100;
 
223
set net_read_timeout=100;
 
224
set net_write_timeout=100;
183
225
set read_buffer_size=100;
184
226
set read_rnd_buffer_size=100;
185
227
set global server_id=100;
 
228
set global slow_launch_time=100;
186
229
set sort_buffer_size=100;
187
230
set sql_big_selects=1;
188
231
set sql_buffer_result=1;
 
232
set sql_log_bin=1;
 
233
set sql_low_priority_updates=1;
 
234
set sql_quote_show_create=1;
 
235
set sql_safe_updates=1;
189
236
set sql_select_limit=1;
190
237
# reset it, so later tests don't get confused
191
238
set sql_select_limit=default;
192
239
set sql_warnings=1;
193
240
set global table_open_cache=100;
194
241
set storage_engine=myisam;
 
242
set global thread_cache_size=100;
195
243
set timestamp=1, timestamp=default;
196
244
set tmp_table_size=100;
197
245
set tx_isolation="READ-COMMITTED";
 
246
set wait_timeout=100;
 
247
 
 
248
#
 
249
# Bugs: #20392: INSERT_ID session variable has weird value
 
250
#
 
251
select @@session.insert_id;
 
252
set @save_insert_id=@@session.insert_id;
 
253
set session insert_id=20;
 
254
select @@session.insert_id;
 
255
 
 
256
set session last_insert_id=100;
 
257
select @@session.insert_id;
 
258
select @@session.last_insert_id;
 
259
select @@session.insert_id;
 
260
 
 
261
set @@session.insert_id=@save_insert_id;
 
262
select @@session.insert_id;
 
263
 
 
264
#
 
265
# key buffer
 
266
#
 
267
 
 
268
create table t1 (a int not null auto_increment, primary key(a));
 
269
create table t2 (a int not null auto_increment, primary key(a));
 
270
insert into t1 values(null),(null),(null);
 
271
insert into t2 values(null),(null),(null);
 
272
set global key_buffer_size=100000;
 
273
select @@key_buffer_size;
 
274
select * from t1 where a=2;
 
275
select * from t2 where a=3;
 
276
check table t1,t2;
 
277
select max(a) +1, max(a) +2 into @xx,@yy from t1;
 
278
drop table t1,t2;
 
279
 
 
280
#
 
281
# error conditions
 
282
#
 
283
 
 
284
--error 1193
 
285
select @@xxxxxxxxxx;
 
286
select 1;
 
287
 
 
288
--error 1238
 
289
select @@session.key_buffer_size;
 
290
 
 
291
--error 1229
 
292
set init_connect = NULL;
 
293
set global init_connect = NULL;
198
294
 
199
295
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
200
296
# expected: check that there is no overflow when 64-bit
204
300
--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
205
301
show global variables like 'myisam_max_sort_file_size';
206
302
--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';
 
303
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
208
304
set global myisam_max_sort_file_size=default;
209
305
 
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;
 
306
#
 
307
# swap
 
308
#
 
309
select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
310
set @svc=@@global.myisam_max_sort_file_size, @svj=@@local.max_join_size;
 
311
select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
312
set @@global.myisam_max_sort_file_size=111,@@local.max_join_size=222;
 
313
select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
314
set @@global.myisam_max_sort_file_size=@@local.max_join_size,@@local.max_join_size=@@global.myisam_max_sort_file_size;
 
315
select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
316
set @@global.myisam_max_sort_file_size=@svc, @@local.max_join_size=@svj;
 
317
select @@global.myisam_max_sort_file_size,@@local.max_join_size;
 
318
set @a=1, @b=2;
 
319
set @a=@b, @b=@a;
 
320
select @a, @b;
 
321
 
 
322
#
 
323
# Bug#2586:Disallow global/session/local as structured var. instance names
 
324
#
 
325
--error 1064
 
326
set @@global.global.key_buffer_size= 1;
 
327
--error 1064
 
328
set GLOBAL global.key_buffer_size= 1;
 
329
--error 1064
 
330
SELECT @@global.global.key_buffer_size;
 
331
--error 1064
 
332
SELECT @@global.session.key_buffer_size;
 
333
--error 1064
 
334
SELECT @@global.local.key_buffer_size;
225
335
 
226
336
#
227
337
# BUG#4788 show create table provides incorrect statement
228
338
#
229
339
# What default width have numeric types?
230
 
create temporary table t1 (
 
340
create table t1 (
231
341
  c1 int,
232
342
  c2 int,
233
343
  c3 int,
238
348
#
239
349
# What types and widths have variables?
240
350
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;
 
351
create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
242
352
show create table t1;
243
353
drop table t1;
244
354
 
248
358
 
249
359
SET GLOBAL table_open_cache=-1;
250
360
SHOW VARIABLES LIKE 'table_open_cache';
251
 
SELECT * FROM DATA_DICTIONARY.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
 
361
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
252
362
SET GLOBAL table_open_cache=DEFAULT;
253
363
 
254
364
#
 
365
# Bugs12363: character_set_results is nullable,
 
366
# but value_ptr returns string "NULL"
 
367
#
 
368
set character_set_results=NULL;
 
369
select ifnull(@@character_set_results,"really null");
 
370
set names latin1;
 
371
 
 
372
 
 
373
#
 
374
# Bug #9613: @@have_innodb
 
375
#
 
376
 
 
377
--replace_column 1 #
 
378
select @@have_innodb;
 
379
 
 
380
#
255
381
# Tests for lc_time_names
256
382
# Note, when adding new locales, please fix ID accordingly:
257
383
# - to test the last ID (currently 108)
268
394
--echo *** LC_TIME_NAMES: testing with string expressions
269
395
set lc_time_names=concat('de','_','DE');
270
396
select @@lc_time_names;
271
 
--error ER_UNKNOWN_ERROR
 
397
--error 1105
272
398
set lc_time_names=concat('de','+','DE');
273
399
select @@lc_time_names;
274
400
--echo LC_TIME_NAMES: testing with numeric expressions
275
401
set @@lc_time_names=1+2;
276
402
select @@lc_time_names;
277
 
--error ER_WRONG_TYPE_FOR_VAR
 
403
--error 1232
278
404
set @@lc_time_names=1/0;
279
405
select @@lc_time_names;
280
406
set lc_time_names=en_US;
281
407
--echo LC_TIME_NAMES: testing NULL and a negative number:
282
 
--error ER_WRONG_VALUE_FOR_VAR
 
408
--error 1231
283
409
set lc_time_names=NULL;
284
 
--error ER_UNKNOWN_ERROR
 
410
--error 1105
285
411
set lc_time_names=-1;
286
412
select @@lc_time_names;
287
413
--echo LC_TIME_NAMES: testing locale with the last ID:
288
414
set lc_time_names=108;
289
415
select @@lc_time_names;
290
416
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
291
 
--error ER_UNKNOWN_ERROR
 
417
--error 1105
292
418
set lc_time_names=109;
293
419
select @@lc_time_names;
294
420
--echo LC_TIME_NAMES: testing that 0 is en_US:
332
458
# Bug#6282 Packet error with SELECT INTO
333
459
334
460
 
335
 
create temporary table t1 (a int);
 
461
create table t1 (a int);
336
462
select a into @x from t1;
337
463
show warnings;
338
464
drop table t1;
341
467
# Bug #10339: read only variables.
342
468
#
343
469
 
344
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
470
--error 1238
345
471
set @@warning_count=1;
346
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
472
--error 1238
347
473
set @@global.error_count=1;
348
474
 
349
475
#
350
476
# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
351
477
#
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
 
478
 
 
479
set @@max_heap_table_size= 4294967296;
 
480
select @@max_heap_table_size > 0;
 
481
set global max_heap_table_size= 4294967296;
 
482
select @@max_heap_table_size > 0;
 
483
set @@max_heap_table_size= 4294967296;
 
484
select @@max_heap_table_size > 0;
 
485
 
363
486
#
364
487
# Bug #11775 Variable character_set_system does not exist (sometimes)
365
488
#
366
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
367
489
select @@character_set_system;
368
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
369
 
set global character_set_system = utf8;
370
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
490
--error 1238
 
491
set global character_set_system = latin1;
 
492
--error 1238
371
493
set @@global.version_compile_os='234';
372
494
 
373
495
#
374
 
# Check character_set_filesystem variable invalid for Drizzle
 
496
# Check character_set_filesystem variable
375
497
#
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;
 
498
set character_set_filesystem=latin1;
 
499
select @@character_set_filesystem;
 
500
set @@global.character_set_filesystem=latin2;
 
501
set character_set_filesystem=latin1;
 
502
select @@character_set_filesystem;
 
503
set @@global.character_set_filesystem=latin2;
 
504
set character_set_filesystem=default;
 
505
select @@character_set_filesystem;
 
506
set @@global.character_set_filesystem=default;
 
507
select @@global.character_set_filesystem;
380
508
 
381
509
#
382
510
# Bug #17849: Show sql_big_selects in SHOW VARIABLES
383
511
#
384
 
set @sql_big_selects = @@sql_big_selects;
 
512
set @old_sql_big_selects = @@sql_big_selects;
385
513
set @@sql_big_selects = 1;
386
514
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;
 
515
select * from information_schema.session_variables where variable_name like 'sql_big_selects';
 
516
set @@sql_big_selects = @old_sql_big_selects;
390
517
 
391
518
#
392
519
# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
394
521
395
522
set @@sql_notes = 0, @@sql_warnings = 0;
396
523
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';
 
524
select * from information_schema.session_variables where variable_name like 'sql_notes';
399
525
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';
 
526
select * from information_schema.session_variables where variable_name like 'sql_warnings';
402
527
set @@sql_notes = 1, @@sql_warnings = 1;
403
528
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';
 
529
select * from information_schema.session_variables where variable_name like 'sql_notes';
406
530
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';
 
531
select * from information_schema.session_variables where variable_name like 'sql_warnings';
 
532
 
 
533
#
 
534
# Bug #12792: @@system_time_zone is not SELECTable.
 
535
#
 
536
# Don't actually output, since it depends on the system
 
537
--replace_column 1 #
 
538
select @@system_time_zone;
409
539
 
410
540
#
411
541
# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
425
555
--replace_column 2 #
426
556
show variables like 'basedir';
427
557
--replace_column 2 #
428
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
429
 
#select * from data_dictionary.session_variables where variable_name like 'basedir';
 
558
select * from information_schema.session_variables where variable_name like 'basedir';
430
559
--replace_column 2 #
431
560
show variables like 'datadir';
432
561
--replace_column 2 #
433
 
# Bug 311025 Segmentation fault when accessing DATA_DICTIONARY
434
 
#select * from data_dictionary.session_variables where variable_name like 'datadir';
 
562
select * from information_schema.session_variables where variable_name like 'datadir';
435
563
--replace_column 2 #
436
564
show variables like 'tmpdir';
437
565
--replace_column 2 #
 
566
select * from information_schema.session_variables where variable_name like 'tmpdir';
 
567
 
 
568
#
 
569
# Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables
 
570
 
571
# Don't actually output, since it depends on the system
 
572
--replace_column 1 # 2 # 3 # 4 # 5 #
 
573
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
 
574
--replace_column 2 #
 
575
show variables like 'ssl%';
 
576
--replace_column 2 #
 
577
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
 
578
 
 
579
#
 
580
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
 
581
# and as @@log_queries_not_using_indexes
 
582
#
 
583
select @@log_queries_not_using_indexes;
 
584
show variables like 'log_queries_not_using_indexes';
 
585
select * from information_schema.session_variables where variable_name like 'log_queries_not_using_indexes';
438
586
 
439
587
#
440
588
# Bug#20908: Crash if select @@""
452
600
# Don't actually output, since it depends on the system
453
601
--replace_column 1 #
454
602
select @@hostname;
455
 
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
603
--error 1238
456
604
set @@hostname= "anothername";
457
605
--replace_column 2 #
458
606
show variables like 'hostname';
465
613
# Bug #19263: variables.test doesn't clean up after itself (II/II --
466
614
# restore)
467
615
#
468
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
 
616
set global binlog_cache_size         =@my_binlog_cache_size;
 
617
set global connect_timeout           =@my_connect_timeout;
 
618
set global flush                     =@my_flush;
469
619
set global flush_time                =@my_flush_time;
 
620
set global key_buffer_size           =@my_key_buffer_size;
 
621
set global max_binlog_cache_size     =default;                #@my_max_binlog_cache_size;
 
622
set global max_binlog_size           =@my_max_binlog_size;
470
623
set global max_connect_errors        =@my_max_connect_errors;
 
624
set global max_connections           =@my_max_connections;
471
625
set global max_heap_table_size       =@my_max_heap_table_size;
472
626
set global max_join_size             =@my_max_join_size;
473
627
# No default
 
628
#set global max_user_connections      =default;
474
629
set global max_write_lock_count      =default;
475
 
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
 
630
set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
 
631
set global net_buffer_length         =@my_net_buffer_length;
 
632
set global net_write_timeout         =@my_net_write_timeout;
 
633
set global net_read_timeout          =@my_net_read_timeout;
 
634
set global rpl_recovery_rank         =@my_rpl_recovery_rank;
476
635
set global server_id                 =@my_server_id;
 
636
set global slow_launch_time          =@my_slow_launch_time;
477
637
set global storage_engine            =@my_storage_engine;
478
 
--error ER_UNKNOWN_SYSTEM_VARIABLE
479
638
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
639
 
521
640
#
522
641
# Bug#28580 Repeatation of status variables
523
642
#
524
 
 
525
643
--replace_column 2 #
526
 
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
 
644
show global variables where Variable_name='table_definition_cache' or
 
645
Variable_name='table_lock_wait_timeout';
 
646
 
 
647
###########################################################################
 
648
 
 
649
--echo
 
650
--echo # --
 
651
--echo # -- Bug#34820: log_output can be set to illegal value.
 
652
--echo # --
 
653
 
 
654
--error ER_WRONG_VALUE_FOR_VAR
 
655
SET GLOBAL log_output = '';
 
656
 
 
657
--error ER_WRONG_VALUE_FOR_VAR
 
658
SET GLOBAL log_output = 0;
 
659
 
 
660
--echo
 
661
--echo # -- End of Bug#34820.
527
662