Commit 33a8fdea authored by unknown's avatar unknown

Merge polly.(none):/home/kaa/src/opt/bug29131/my51-bug29131

into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
parents 849dec44 07219e4d
......@@ -175,3 +175,66 @@ SET GLOBAL slow_query_log = ON;
SET GLOBAL READ_ONLY = OFF;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
SET @old_general_log_state = @@global.general_log;
SET @old_slow_log_state = @@global.slow_query_log;
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log ON
SHOW VARIABLES LIKE 'log';
Variable_name Value
log ON
SELECT @@general_log, @@log;
@@general_log @@log
1 1
SET GLOBAL log = 0;
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log OFF
SHOW VARIABLES LIKE 'log';
Variable_name Value
log OFF
SELECT @@general_log, @@log;
@@general_log @@log
0 0
SET GLOBAL general_log = 1;
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log ON
SHOW VARIABLES LIKE 'log';
Variable_name Value
log ON
SELECT @@general_log, @@log;
@@general_log @@log
1 1
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log OFF
SHOW VARIABLES LIKE 'log_slow_queries';
Variable_name Value
log_slow_queries OFF
SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
0 0
SET GLOBAL log_slow_queries = 0;
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log OFF
SHOW VARIABLES LIKE 'log_slow_queries';
Variable_name Value
log_slow_queries OFF
SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
0 0
SET GLOBAL slow_query_log = 1;
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log ON
SHOW VARIABLES LIKE 'log_slow_queries';
Variable_name Value
log_slow_queries ON
SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
1 1
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
End of 5.1 tests
......@@ -179,6 +179,42 @@ SET GLOBAL READ_ONLY = OFF;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
#
# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
#
SET @old_general_log_state = @@global.general_log;
SET @old_slow_log_state = @@global.slow_query_log;
SHOW VARIABLES LIKE 'general_log';
SHOW VARIABLES LIKE 'log';
SELECT @@general_log, @@log;
SET GLOBAL log = 0;
SHOW VARIABLES LIKE 'general_log';
SHOW VARIABLES LIKE 'log';
SELECT @@general_log, @@log;
SET GLOBAL general_log = 1;
SHOW VARIABLES LIKE 'general_log';
SHOW VARIABLES LIKE 'log';
SELECT @@general_log, @@log;
SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@slow_query_log, @@log_slow_queries;
SET GLOBAL log_slow_queries = 0;
SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@slow_query_log, @@log_slow_queries;
SET GLOBAL slow_query_log = 1;
SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@slow_query_log, @@log_slow_queries;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
--echo End of 5.1 tests
--enable_ps_protocol
#
......
......@@ -641,8 +641,14 @@ static sys_var_const_str sys_license(&vars, "license", STRINGIFY_ARG(LICENSE));
/* Global variables which enable|disable logging */
static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log,
QUERY_LOG_GENERAL);
/* Synonym of "general_log" for consistency with SHOW VARIABLES output */
static sys_var_log_state sys_var_log(&vars, "log", &opt_log,
QUERY_LOG_GENERAL);
static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log,
QUERY_LOG_SLOW);
/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */
static sys_var_log_state sys_var_log_slow(&vars, "log_slow_queries",
&opt_slow_log, QUERY_LOG_SLOW);
sys_var_str sys_var_general_log_path(&vars, "general_log_file", sys_check_log_path,
sys_update_general_log_path,
sys_default_general_log_path,
......@@ -678,10 +684,8 @@ static SHOW_VAR fixed_vars[]= {
#ifdef HAVE_MLOCKALL
{"locked_in_memory", (char*) &locked_in_memory, SHOW_MY_BOOL},
#endif
{"log", (char*) &opt_log, SHOW_MY_BOOL},
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
{"log_error", (char*) log_error_file, SHOW_CHAR},
{"log_slow_queries", (char*) &opt_slow_log, SHOW_MY_BOOL},
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment