1
1
drop table if exists t1,t2;
2
set @my_connect_timeout =@@global.connect_timeout;
3
set @my_flush =@@global.flush;
4
set @my_key_buffer_size =@@global.key_buffer_size;
2
5
set @my_max_connect_errors =@@global.max_connect_errors;
3
6
set @my_max_heap_table_size =@@global.max_heap_table_size;
4
7
set @my_max_join_size =@@global.max_join_size;
5
set @my_mysql_protocol_buffer_length =@@global.mysql_protocol_buffer_length;
8
set @my_net_buffer_length =@@global.net_buffer_length;
9
set @my_net_write_timeout =@@global.net_write_timeout;
10
set @my_net_read_timeout =@@global.net_read_timeout;
6
11
set @my_server_id =@@global.server_id;
7
12
set @my_storage_engine =@@global.storage_engine;
8
set @my_myisam_sort_buffer_size =@@global.myisam_sort_buffer_size;
9
set @my_tx_isolation =@@global.tx_isolation;
11
14
select @test, @`test`, @TEST, @`TEST`, @"teSt";
12
15
@test @`test` @TEST @`TEST` @"teSt"
84
87
show variables like 'max_join_size';
85
88
Variable_name Value
87
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
90
select * from information_schema.session_variables where variable_name like 'max_join_size';
88
91
VARIABLE_NAME VARIABLE_VALUE
90
93
show global variables like 'max_join_size';
91
94
Variable_name Value
93
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';
94
97
VARIABLE_NAME VARIABLE_VALUE
96
99
set GLOBAL max_join_size=2000;
97
100
show global variables like 'max_join_size';
98
101
Variable_name Value
99
102
max_join_size 2000
100
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
103
select * from information_schema.global_variables where variable_name like 'max_join_size';
101
104
VARIABLE_NAME VARIABLE_VALUE
103
106
set max_join_size=DEFAULT;
104
107
show variables like 'max_join_size';
105
108
Variable_name Value
106
109
max_join_size 2000
107
select * from data_dictionary.session_variables where variable_name like 'max_join_size';
110
select * from information_schema.session_variables where variable_name like 'max_join_size';
108
111
VARIABLE_NAME VARIABLE_VALUE
110
113
set GLOBAL max_join_size=DEFAULT;
111
114
show global variables like 'max_join_size';
112
115
Variable_name Value
113
116
max_join_size 2147483647
114
select * from data_dictionary.global_variables where variable_name like 'max_join_size';
117
select * from information_schema.global_variables where variable_name like 'max_join_size';
115
118
VARIABLE_NAME VARIABLE_VALUE
116
max_join_size 2147483647
119
MAX_JOIN_SIZE 2147483647
117
120
set @@max_join_size=1000, @@global.max_join_size=2000;
118
121
select @@local.max_join_size, @@global.max_join_size;
119
122
@@local.max_join_size @@global.max_join_size
144
147
show variables like 'timed_mutexes';
145
148
Variable_name Value
147
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
150
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
148
151
VARIABLE_NAME VARIABLE_VALUE
150
153
set global timed_mutexes=0;
151
154
show variables like 'timed_mutexes';
152
155
Variable_name Value
153
156
timed_mutexes OFF
154
select * from data_dictionary.session_variables where variable_name like 'timed_mutexes';
157
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
155
158
VARIABLE_NAME VARIABLE_VALUE
157
set storage_engine=MYISAM, storage_engine="MEMORY";
160
set storage_engine=MYISAM, storage_engine="HEAP";
158
161
show local variables like 'storage_engine';
159
162
Variable_name Value
160
163
storage_engine MEMORY
161
select * from data_dictionary.session_variables where variable_name like 'storage_engine';
164
select * from information_schema.session_variables where variable_name like 'storage_engine';
162
165
VARIABLE_NAME VARIABLE_VALUE
163
storage_engine MEMORY
166
STORAGE_ENGINE MEMORY
164
167
show global variables like 'storage_engine';
165
168
Variable_name Value
166
169
storage_engine InnoDB
167
select * from data_dictionary.global_variables where variable_name like 'storage_engine';
170
select * from information_schema.global_variables where variable_name like 'storage_engine';
168
171
VARIABLE_NAME VARIABLE_VALUE
169
storage_engine InnoDB
172
STORAGE_ENGINE InnoDB
170
173
set GLOBAL myisam_max_sort_file_size=2000000;
171
174
show global variables like 'myisam_max_sort_file_size';
172
175
Variable_name Value
173
176
myisam_max_sort_file_size 2000000
174
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
177
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
175
178
VARIABLE_NAME VARIABLE_VALUE
176
myisam_max_sort_file_size 2000000
179
MYISAM_MAX_SORT_FILE_SIZE 2000000
177
180
set GLOBAL myisam_max_sort_file_size=default;
178
181
show global variables like 'myisam_max_sort_file_size';
179
182
Variable_name Value
180
183
myisam_max_sort_file_size 2147483647
181
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
182
VARIABLE_NAME VARIABLE_VALUE
183
myisam_max_sort_file_size 2147483647
184
set global mysql_protocol_buffer_length=1024;
185
show global variables like 'mysql_protocol_buffer_%';
187
mysql_protocol_buffer_length 1024
188
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
189
VARIABLE_NAME VARIABLE_VALUE
190
mysql_protocol_buffer_length 1024
191
show global variables like 'mysql_protocol_buffer_%';
193
mysql_protocol_buffer_length 1024
194
select * from data_dictionary.global_variables where variable_name like 'mysql_protocol_buffer_%';
195
VARIABLE_NAME VARIABLE_VALUE
196
mysql_protocol_buffer_length 1024
197
set global mysql_protocol_buffer_length=1;
199
Error 1524 Error setting mysql_protocol_buffer_length. Given value 1 (< 1024)
200
show variables like 'mysql_protocol_buffer_length';
202
mysql_protocol_buffer_length 1024
203
set global mysql_protocol_buffer_length=2000000000;
205
Error 1524 Error setting mysql_protocol_buffer_length. Given value 2000000000 (> 1048576)
206
show variables like 'mysql_protocol_buffer_length';
208
mysql_protocol_buffer_length 1024
184
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
185
VARIABLE_NAME VARIABLE_VALUE
186
MYISAM_MAX_SORT_FILE_SIZE 2147483647
187
set global net_retry_count=10, session net_retry_count=10;
188
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
189
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
190
show global variables like 'net_%';
192
net_buffer_length 1024
195
net_write_timeout 200
196
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
197
VARIABLE_NAME VARIABLE_VALUE
198
NET_BUFFER_LENGTH 1024
201
NET_WRITE_TIMEOUT 200
202
show session variables like 'net_%';
204
net_buffer_length 2048
207
net_write_timeout 500
208
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
209
VARIABLE_NAME VARIABLE_VALUE
210
NET_BUFFER_LENGTH 2048
213
NET_WRITE_TIMEOUT 500
214
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
215
show global variables like 'net_%';
217
net_buffer_length 1024
220
net_write_timeout 1000
221
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
222
VARIABLE_NAME VARIABLE_VALUE
223
NET_BUFFER_LENGTH 1024
226
NET_WRITE_TIMEOUT 1000
227
show session variables like 'net_%';
229
net_buffer_length 7168
232
net_write_timeout 500
233
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
234
VARIABLE_NAME VARIABLE_VALUE
235
NET_BUFFER_LENGTH 7168
238
NET_WRITE_TIMEOUT 500
239
set net_buffer_length=1;
241
Error 1292 Truncated incorrect net_buffer_length value: '1'
242
show variables like 'net_buffer_length';
244
net_buffer_length 1024
245
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
246
VARIABLE_NAME VARIABLE_VALUE
247
NET_BUFFER_LENGTH 1024
248
set net_buffer_length=2000000000;
250
Error 1292 Truncated incorrect net_buffer_length value: '2000000000'
251
show variables like 'net_buffer_length';
253
net_buffer_length 1048576
254
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
255
VARIABLE_NAME VARIABLE_VALUE
256
NET_BUFFER_LENGTH 1048576
209
257
show variables like '%alloc%';
210
258
Variable_name Value
211
259
innodb_use_sys_malloc ON
212
260
query_alloc_block_size 8192
213
261
query_prealloc_size 8192
214
range_alloc_block_size 4096
215
select * from data_dictionary.session_variables where variable_name like '%alloc%';
262
range_alloc_block_size
263
transaction_alloc_block_size 8192
264
transaction_prealloc_size 4096
265
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
216
266
VARIABLE_NAME VARIABLE_VALUE
217
innodb_use_sys_malloc ON
218
query_alloc_block_size 8192
219
query_prealloc_size 8192
220
range_alloc_block_size 4096
267
INNODB_USE_SYS_MALLOC ON
268
QUERY_ALLOC_BLOCK_SIZE 8192
269
QUERY_PREALLOC_SIZE 8192
270
RANGE_ALLOC_BLOCK_SIZE
271
TRANSACTION_ALLOC_BLOCK_SIZE 8192
272
TRANSACTION_PREALLOC_SIZE 4096
221
273
set @@range_alloc_block_size=1024*16;
222
274
set @@query_alloc_block_size=1024*17+2;
223
275
set @@query_prealloc_size=1024*18;
276
set @@transaction_alloc_block_size=1024*20-1;
277
set @@transaction_prealloc_size=1024*21-1;
224
278
select @@query_alloc_block_size;
225
279
@@query_alloc_block_size
229
283
innodb_use_sys_malloc ON
230
284
query_alloc_block_size 17408
231
285
query_prealloc_size 18432
232
range_alloc_block_size 16384
233
select * from data_dictionary.session_variables where variable_name like '%alloc%';
286
range_alloc_block_size
287
transaction_alloc_block_size 19456
288
transaction_prealloc_size 20480
289
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
234
290
VARIABLE_NAME VARIABLE_VALUE
235
innodb_use_sys_malloc ON
236
query_alloc_block_size 17408
237
query_prealloc_size 18432
238
range_alloc_block_size 16384
291
INNODB_USE_SYS_MALLOC ON
292
QUERY_ALLOC_BLOCK_SIZE 17408
293
QUERY_PREALLOC_SIZE 18432
294
RANGE_ALLOC_BLOCK_SIZE
295
TRANSACTION_ALLOC_BLOCK_SIZE 19456
296
TRANSACTION_PREALLOC_SIZE 20480
239
297
set @@range_alloc_block_size=default;
240
298
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
299
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
241
300
show variables like '%alloc%';
242
301
Variable_name Value
243
302
innodb_use_sys_malloc ON
244
303
query_alloc_block_size 8192
245
304
query_prealloc_size 8192
246
range_alloc_block_size 4096
247
select * from data_dictionary.session_variables where variable_name like '%alloc%';
305
range_alloc_block_size
306
transaction_alloc_block_size 8192
307
transaction_prealloc_size 4096
308
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
248
309
VARIABLE_NAME VARIABLE_VALUE
249
innodb_use_sys_malloc ON
250
query_alloc_block_size 8192
251
query_prealloc_size 8192
252
range_alloc_block_size 4096
310
INNODB_USE_SYS_MALLOC ON
311
QUERY_ALLOC_BLOCK_SIZE 8192
312
QUERY_PREALLOC_SIZE 8192
313
RANGE_ALLOC_BLOCK_SIZE
314
TRANSACTION_ALLOC_BLOCK_SIZE 8192
315
TRANSACTION_PREALLOC_SIZE 4096
253
316
SELECT @@version LIKE 'non-existent';
254
317
@@version LIKE 'non-existent'
320
400
Error 1292 Truncated incorrect tmp_table_size value: '100'
321
401
set tx_isolation="READ-COMMITTED";
402
set wait_timeout=100;
403
create table t1 (a int not null auto_increment, primary key(a));
404
create table t2 (a int not null auto_increment, primary key(a));
405
insert into t1 values(null),(null),(null);
406
insert into t2 values(null),(null),(null);
407
set global key_buffer_size=100000;
408
select @@key_buffer_size;
411
select * from t1 where a=2;
414
select * from t2 where a=3;
418
Table Op Msg_type Msg_text
419
test.t1 check status OK
420
test.t2 check status OK
421
select max(a) +1, max(a) +2 into @xx,@yy from t1;
424
ERROR HY000: Unknown system variable 'xxxxxxxxxx'
428
select @@session.key_buffer_size;
429
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable
322
430
set global myisam_max_sort_file_size=4294967296;
323
431
show global variables like 'myisam_max_sort_file_size';
324
432
Variable_name Value
325
433
myisam_max_sort_file_size MAX_FILE_SIZE
326
select * from data_dictionary.global_variables where variable_name like 'myisam_max_sort_file_size';
434
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
327
435
VARIABLE_NAME VARIABLE_VALUE
328
myisam_max_sort_file_size MAX_FILE_SIZE
436
MYISAM_MAX_SORT_FILE_SIZE MAX_FILE_SIZE
329
437
set global myisam_max_sort_file_size=default;
330
create temporary table t1 (
438
set @@global.global.key_buffer_size= 1;
439
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_buffer_size= 1' at line 1
440
set GLOBAL global.key_buffer_size= 1;
441
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_buffer_size= 1' at line 1
442
SELECT @@global.global.key_buffer_size;
443
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_buffer_size' at line 1
444
SELECT @@global.session.key_buffer_size;
445
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_buffer_size' at line 1
446
SELECT @@global.local.key_buffer_size;
447
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_buffer_size' at line 1
336
454
show create table t1;
337
455
Table Create Table
338
t1 CREATE TEMPORARY TABLE `t1` (
339
`c1` INT DEFAULT NULL,
340
`c2` INT DEFAULT NULL,
341
`c3` INT DEFAULT NULL,
342
`c4` INT DEFAULT NULL,
343
`c5` BIGINT DEFAULT NULL
344
) ENGINE=MyISAM COLLATE = utf8_general_ci
456
t1 CREATE TABLE `t1` (
457
`c1` int DEFAULT NULL,
458
`c2` int DEFAULT NULL,
459
`c3` int DEFAULT NULL,
460
`c4` int DEFAULT NULL,
461
`c5` bigint DEFAULT NULL
346
464
set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0;
347
create temporary table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
465
create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;
348
466
show create table t1;
349
467
Table Create Table
350
t1 CREATE TEMPORARY TABLE `t1` (
351
`c1` BIGINT DEFAULT NULL,
352
`c2` DECIMAL(65,30) DEFAULT NULL,
353
`c3` TEXT COLLATE utf8_general_ci,
354
`c4` DOUBLE DEFAULT NULL
355
) ENGINE=MyISAM COLLATE = utf8_general_ci
468
t1 CREATE TABLE `t1` (
469
`c1` bigint DEFAULT NULL,
470
`c2` decimal(65,30) DEFAULT NULL,
472
`c4` double DEFAULT NULL
357
475
SET GLOBAL table_open_cache=-1;
531
661
Variable_name Value
664
set global connect_timeout =@my_connect_timeout;
665
set global flush =@my_flush;
534
666
set global flush_time =@my_flush_time;
535
667
ERROR HY000: Unknown system variable 'flush_time'
668
set global key_buffer_size =@my_key_buffer_size;
536
669
set global max_connect_errors =@my_max_connect_errors;
537
670
set global max_heap_table_size =@my_max_heap_table_size;
538
671
set global max_join_size =@my_max_join_size;
539
672
set global max_write_lock_count =default;
540
set global mysql_protocol_buffer_length= @my_mysql_protocol_buffer_length;
673
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
674
ERROR 42000: Incorrect argument type to variable 'myisam_data_pointer_size'
675
set global net_buffer_length =@my_net_buffer_length;
676
set global net_write_timeout =@my_net_write_timeout;
677
set global net_read_timeout =@my_net_read_timeout;
541
678
set global server_id =@my_server_id;
542
679
set global storage_engine =@my_storage_engine;
543
680
set global thread_cache_size =@my_thread_cache_size;
544
681
ERROR HY000: Unknown system variable 'thread_cache_size'
545
set global myisam_sort_buffer_size =@my_myisam_sort_buffer_size;
546
SHOW GLOBAL VARIABLES LIKE 'max_join_size';
548
max_join_size 2147483647
549
SHOW LOCAL VARIABLES LIKE 'max_join_size';
552
set GLOBAL bulk_insert_buffer_size=DEFAULT;
553
set GLOBAL join_buffer_size=DEFAULT;
554
set GLOBAL max_allowed_packet=DEFAULT;
555
set GLOBAL max_connect_errors=DEFAULT;
556
set GLOBAL max_heap_table_size=DEFAULT;
557
set GLOBAL max_join_size=DEFAULT;
558
set GLOBAL max_sort_length=DEFAULT;
559
set GLOBAL max_write_lock_count=DEFAULT;
560
set GLOBAL myisam_sort_buffer_size=DEFAULT;
561
set GLOBAL mysql_protocol_buffer_length=DEFAULT;
562
set GLOBAL read_buffer_size=DEFAULT;
563
set GLOBAL read_rnd_buffer_size=DEFAULT;
564
set GLOBAL server_id=DEFAULT;
565
set GLOBAL sort_buffer_size=DEFAULT;
566
set GLOBAL table_open_cache=DEFAULT;
567
set GLOBAL storage_engine= @my_storage_engine;
568
set GLOBAL tmp_table_size=DEFAULT;
569
set GLOBAL tx_isolation= @my_tx_isolation;
570
set SESSION bulk_insert_buffer_size=DEFAULT;
571
set SESSION join_buffer_size=DEFAULT;
572
set SESSION max_allowed_packet=DEFAULT;
573
set SESSION max_heap_table_size=DEFAULT;
574
set SESSION max_join_size=DEFAULT;
575
set SESSION max_sort_length=DEFAULT;
576
set SESSION read_buffer_size=DEFAULT;
577
set SESSION read_rnd_buffer_size=DEFAULT;
578
set SESSION sort_buffer_size=DEFAULT;
579
set SESSION sql_big_selects=DEFAULT;
580
set SESSION sql_buffer_result=DEFAULT;
581
set SESSION sql_select_limit=DEFAULT;
582
set SESSION sql_warnings=DEFAULT;
583
set SESSION storage_engine= @my_storage_engine;
584
set SESSION tmp_table_size=DEFAULT;
585
set SESSION tx_isolation= @my_tx_isolation;
586
show global variables where variable_name='table_definition_cache' or Variable_name='table_lock_wait_timeout';
588
table_definition_cache #
589
table_lock_wait_timeout #