📄 variables.test
字号:
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as# expected: check that there is no overflow when 64-bit unsigned# variables are setset global myisam_max_sort_file_size=4294967296;--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZEshow global variables like 'myisam_max_sort_file_size';set global myisam_max_sort_file_size=default;## swap#select @@global.max_user_connections,@@local.max_join_size;set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;select @@global.max_user_connections,@@local.max_join_size;set @@global.max_user_connections=111,@@local.max_join_size=222;select @@global.max_user_connections,@@local.max_join_size;set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;select @@global.max_user_connections,@@local.max_join_size;set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;select @@global.max_user_connections,@@local.max_join_size;set @a=1, @b=2;set @a=@b, @b=@a;select @a, @b;## Bug#2586:Disallow global/session/local as structured var. instance names#--error 1064set @@global.global.key_buffer_size= 1;--error 1064set GLOBAL global.key_buffer_size= 1;--error 1064SELECT @@global.global.key_buffer_size;--error 1064SELECT @@global.session.key_buffer_size;--error 1064SELECT @@global.local.key_buffer_size;# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)set @tstlw = @@log_warnings;show global variables like 'log_warnings';set global log_warnings = 0;show global variables like 'log_warnings';set global log_warnings = 42;show global variables like 'log_warnings';set global log_warnings = @tstlw;show global variables like 'log_warnings';## BUG#4788 show create table provides incorrect statement## What default width have numeric types?create table t1 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 bigint);show create table t1;drop table t1;## What types and widths have variables?set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0;create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4;show create table t1;drop table t1;## Bug #6993: myisam_data_pointer_size# Wrong bug report, data pointer size must be restricted to 7,# setting to 8 will not work on all computers, myisamchk and# the server may see a wrong value, such as 0 or negative number# if 8 bytes is set.#SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';## Bug #6958: negative arguments to integer options wrap around#SET GLOBAL table_cache=-1;SHOW VARIABLES LIKE 'table_cache';SET GLOBAL table_cache=DEFAULT;## Bugs12363: character_set_results is nullable,# but value_ptr returns string "NULL"#set character_set_results=NULL;select ifnull(@@character_set_results,"really null");set names latin1;## Bug #9613: @@have_innodb#--replace_column 1 #select @@have_innodb;## Tests for lc_time_names# Note, when adding new locales, please fix ID accordingly:# - to test the last ID (currently 108)# - and the next after the last (currently 109)#--echo *** Various tests with LC_TIME_NAMES--echo *** LC_TIME_NAMES: testing case insensitivityset @@lc_time_names='ru_ru';select @@lc_time_names;--echo *** LC_TIME_NAMES: testing with a user variableset @lc='JA_JP';set @@lc_time_names=@lc;select @@lc_time_names;--echo *** LC_TIME_NAMES: testing with string expressionsset lc_time_names=concat('de','_','DE');select @@lc_time_names;--error 1105set lc_time_names=concat('de','+','DE');select @@lc_time_names;--echo LC_TIME_NAMES: testing with numeric expressionsset @@lc_time_names=1+2;select @@lc_time_names;--error 1232set @@lc_time_names=1/0;select @@lc_time_names;set lc_time_names=en_US;--echo LC_TIME_NAMES: testing NULL and a negative number:--error 1231set lc_time_names=NULL;--error 1105set lc_time_names=-1;select @@lc_time_names;--echo LC_TIME_NAMES: testing locale with the last ID:set lc_time_names=108;select @@lc_time_names;--echo LC_TIME_NAMES: testing a number beyond the valid ID range:--error 1105set lc_time_names=109;select @@lc_time_names;--echo LC_TIME_NAMES: testing that 0 is en_US:set lc_time_names=0;select @@lc_time_names;## Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect#select @@global.lc_time_names, @@lc_time_names;set @@global.lc_time_names=fr_FR;select @@global.lc_time_names, @@lc_time_names;--echo New connectionconnect (con1,localhost,root,,);connection con1;select @@global.lc_time_names, @@lc_time_names;set @@lc_time_names=ru_RU;select @@global.lc_time_names, @@lc_time_names;disconnect con1;connection default;--echo Returnung to default connectionselect @@global.lc_time_names, @@lc_time_names;set lc_time_names=default;select @@global.lc_time_names, @@lc_time_names;set @@global.lc_time_names=default;select @@global.lc_time_names, @@lc_time_names;set @@lc_time_names=default;select @@global.lc_time_names, @@lc_time_names;## Bug #13334: query_prealloc_size default less than minimum#set @test = @@query_prealloc_size;set @@query_prealloc_size = @test;select @@query_prealloc_size = @test;# End of 4.1 tests## Bug#6282 Packet error with SELECT INTO# create table t1 (a int);select a into @x from t1;show warnings;drop table t1;## Bug #10339: read only variables.#--error 1238set @@warning_count=1;--error 1238set @@global.error_count=1;## Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform#set @@max_heap_table_size= 4294967296;select @@max_heap_table_size > 0;set global max_heap_table_size= 4294967296;select @@max_heap_table_size > 0;set @@max_heap_table_size= 4294967296;select @@max_heap_table_size > 0;## Bug #11775 Variable character_set_system does not exist (sometimes)#select @@character_set_system;--error 1238set global character_set_system = latin1;--error 1238set @@global.version_compile_os='234';## Check character_set_filesystem variable#set character_set_filesystem=latin1;select @@character_set_filesystem;set @@global.character_set_filesystem=latin2;set character_set_filesystem=latin1;select @@character_set_filesystem;set @@global.character_set_filesystem=latin2;set character_set_filesystem=default;select @@character_set_filesystem;set @@global.character_set_filesystem=default;select @@global.character_set_filesystem;## Bug #17849: Show sql_big_selects in SHOW VARIABLES#set @old_sql_big_selects = @@sql_big_selects;set @@sql_big_selects = 1;show variables like 'sql_big_selects';set @@sql_big_selects = @old_sql_big_selects;## Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and# sql_notes values# set @@sql_notes = 0, @@sql_warnings = 0;show variables like 'sql_notes';show variables like 'sql_warnings';set @@sql_notes = 1, @@sql_warnings = 1;show variables like 'sql_notes';show variables like 'sql_warnings';## Bug #12792: @@system_time_zone is not SELECTable.## Don't actually output, since it depends on the system--replace_column 1 #select @@system_time_zone;## Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)## Don't actually output, since it depends on the system--replace_column 1 # 2 # 3 # 4 #select @@version, @@version_comment, @@version_compile_machine, @@version_compile_os;## Bug #1039: make tmpdir and datadir available as @@variables (also included# basedir)## Don't actually output, since it depends on the system--replace_column 1 # 2 # 3 #select @@basedir, @@datadir, @@tmpdir;--replace_column 2 #show variables like 'basedir';--replace_column 2 #show variables like 'datadir';--replace_column 2 #show variables like 'tmpdir';## Bug #19606: make ssl settings available via SHOW VARIABLES and @@variables# # Don't actually output, since it depends on the system--replace_column 1 # 2 # 3 # 4 # 5 #select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;--replace_column 2 #show variables like 'ssl%';## Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES# and as @@log_queries_not_using_indexes#select @@log_queries_not_using_indexes;show variables like 'log_queries_not_using_indexes';## Bug#20908: Crash if select @@""#--error ER_PARSE_ERRORselect @@"";--error ER_PARSE_ERRORselect @@&;--error ER_PARSE_ERRORselect @@@;## Bug#20166 mysql-test-run.pl does not test system privilege tables creation## Don't actually output, since it depends on the system--replace_column 1 #select @@hostname;--error 1238set @@hostname= "anothername";--replace_column 2 #show variables like 'hostname';--echo End of 5.0 tests# This is at the very after the versioned tests, since it involves doing# cleanup## Bug #19263: variables.test doesn't clean up after itself (II/II --# restore)#set global binlog_cache_size =@my_binlog_cache_size;set global connect_timeout =@my_connect_timeout;set global delayed_insert_timeout =@my_delayed_insert_timeout;set global delayed_queue_size =@my_delayed_queue_size;set global flush =@my_flush;set global flush_time =@my_flush_time;set global key_buffer_size =@my_key_buffer_size;set global max_binlog_cache_size =default; #@my_max_binlog_cache_size;set global max_binlog_size =@my_max_binlog_size;set global max_connect_errors =@my_max_connect_errors;set global max_delayed_threads =@my_max_delayed_threads;set global max_heap_table_size =@my_max_heap_table_size;set global max_insert_delayed_threads=@my_max_insert_delayed_threads;set global max_join_size =@my_max_join_size;set global max_user_connections =@my_max_user_connections;set global max_write_lock_count =@my_max_write_lock_count;set global myisam_data_pointer_size =@my_myisam_data_pointer_size;set global net_buffer_length =@my_net_buffer_length;set global net_write_timeout =@my_net_write_timeout;set global net_read_timeout =@my_net_read_timeout;set global query_cache_limit =@my_query_cache_limit;set global query_cache_type =@my_query_cache_type;set global rpl_recovery_rank =@my_rpl_recovery_rank;set global server_id =@my_server_id;set global slow_launch_time =@my_slow_launch_time;set global storage_engine =@my_storage_engine;set global thread_cache_size =@my_thread_cache_size;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -