diff options
author | Georgi Kodinov <joro@sun.com> | 2010-03-31 16:12:37 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2010-03-31 16:12:37 +0300 |
commit | e65caec1387ecc3b25a3a97c5ccedb9c16caa0ef (patch) | |
tree | ea9d013ac400a69d621d922b7a8a309f584d09af | |
parent | 6eca53f1d382a247456d29794c70338f972b77a9 (diff) | |
download | mariadb-git-e65caec1387ecc3b25a3a97c5ccedb9c16caa0ef.tar.gz |
Bug #37168: Missing variable - skip_name_resolve
Added a read-only global boolean variable skip_name_resolve.
-rw-r--r-- | mysql-test/r/skip_name_resolve.result | 27 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 9 | ||||
-rw-r--r-- | mysql-test/t/skip_name_resolve.test | 21 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 8 | ||||
-rw-r--r-- | sql/mysql_priv.h | 1 | ||||
-rw-r--r-- | sql/mysqld.cc | 3 | ||||
-rw-r--r-- | sql/set_var.cc | 4 |
7 files changed, 73 insertions, 0 deletions
diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 8aa9877a8e9..1d92d52110d 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -9,3 +9,30 @@ SELECT USER(); USER() # SHOW PROCESSLIST; +# +# Bug #37168: Missing variable - skip_name_resolve +# +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SELECT @@skip_name_resolve; +@@skip_name_resolve +1 +SELECT @@LOCAL.skip_name_resolve; +ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable +SELECT @@GLOBAL.skip_name_resolve; +@@GLOBAL.skip_name_resolve +1 +SET @@skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@LOCAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@GLOBAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +End of 5.1 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index ff6d4cf85d9..94a7661d327 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1495,4 +1495,13 @@ SELECT @@GLOBAL.max_binlog_cache_size; @@GLOBAL.max_binlog_cache_size 5368709120 SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; +# +# Bug #37168 : Missing variable - skip_name_resolve +# +SELECT @@skip_name_resolve; +@@skip_name_resolve +0 +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve OFF End of 5.1 tests diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test index df010d15fa0..0edbdbcd22c 100644 --- a/mysql-test/t/skip_name_resolve.test +++ b/mysql-test/t/skip_name_resolve.test @@ -29,3 +29,24 @@ disconnect con1; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc +--echo # +--echo # Bug #37168: Missing variable - skip_name_resolve +--echo # + +SHOW VARIABLES LIKE 'skip_name_resolve'; +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; + +SELECT @@skip_name_resolve; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@LOCAL.skip_name_resolve; +SELECT @@GLOBAL.skip_name_resolve; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@LOCAL.skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.skip_name_resolve=0; + +--echo End of 5.1 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 6c9015a1bff..7b3ea599b9e 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1232,4 +1232,12 @@ SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024; SELECT @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; + +--echo # +--echo # Bug #37168 : Missing variable - skip_name_resolve +--echo # + +SELECT @@skip_name_resolve; +SHOW VARIABLES LIKE 'skip_name_resolve'; + --echo End of 5.1 tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 098ea514cb6..56175d069c5 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1990,6 +1990,7 @@ extern my_bool opt_log, opt_slow_log; extern ulong log_output_options; extern my_bool opt_log_queries_not_using_indexes; extern bool opt_disable_networking, opt_skip_show_db; +extern bool opt_skip_name_resolve; extern bool opt_ignore_builtin_innodb; extern my_bool opt_character_set_client_handshake; extern bool volatile abort_loop, shutdown_in_progress; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bb685ba42e3..716a5ff0305 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -410,6 +410,7 @@ ulong log_output_options; my_bool opt_log_queries_not_using_indexes= 0; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; +bool opt_skip_name_resolve=0; my_bool opt_character_set_client_handshake= 1; bool server_id_supplied = 0; bool opt_endinfo, using_udf_functions; @@ -7715,6 +7716,7 @@ static int mysql_init_variables(void) log_output_options= find_bit_type(log_output_str, &log_output_typelib); opt_bin_log= 0; opt_disable_networking= opt_skip_show_db=0; + opt_skip_name_resolve= 0; opt_ignore_builtin_innodb= 0; opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0; opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name ! @@ -8241,6 +8243,7 @@ mysqld_get_one_option(int optid, opt_specialflag|= SPECIAL_NO_HOST_CACHE; break; case (int) OPT_SKIP_RESOLVE: + opt_skip_name_resolve= 1; opt_specialflag|=SPECIAL_NO_RESOLVE; break; case (int) OPT_SKIP_NETWORKING: diff --git a/sql/set_var.cc b/sql/set_var.cc index 0a9541b9f2c..f7d9d9df42e 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -533,6 +533,10 @@ static sys_var_const sys_skip_show_database(&vars, "skip_show_database", OPT_GLOBAL, SHOW_BOOL, (uchar*) &opt_skip_show_db); +static sys_var_const sys_skip_name_resolve(&vars, "skip_name_resolve", + OPT_GLOBAL, SHOW_BOOL, + (uchar*) &opt_skip_name_resolve); + static sys_var_const sys_socket(&vars, "socket", OPT_GLOBAL, SHOW_CHAR_PTR, (uchar*) &mysqld_unix_port); |