#At file:///home/tnurnberg/forest/4403/51-4403/
2741 Tatiana A. Nurnberg 2008-09-20
WL#4403 deprecate @log and @slow_log_queries variables
Adds --general-log-file, --slow-query-log-file command-
line options to match system variables of the same names.
Deprecates --log, --log-slow-queries command-line option
and log, log_slow_queries system-variables for v7.0; they
are superseded by general_log/general_log_file and
slow_query_log/slow_query_log_file, respectively.
modified:
mysql-test/r/log_basic.result
mysql-test/r/log_state.result
mysql-test/t/log_basic.test
mysql-test/t/log_state.test
sql/mysqld.cc
sql/set_var.cc
per-file messages:
mysql-test/r/log_basic.result
Change deprecated system variable "log" to
general log.
mysql-test/r/log_state.result
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
mysql-test/t/log_basic.test
Change deprecated system variable "log" to
general log.
mysql-test/t/log_state.test
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
sql/mysqld.cc
Add command-line options --general-log-file and
--slow-query-log-file to match server options of
the same name.
Deprecated --log and --log-slow-queries command-line
options; they are superseded by --general-log/
--general-log-file and --slow-query-log/--slow-query-log-file,
respectively
sql/set_var.cc
Deprecate system-variables log in favour of general_log,
log_slow_queries in favour of slow_query_log for 7.0,
both for value- and DEFAULT-setting.
=== modified file 'mysql-test/r/log_basic.result'
--- a/mysql-test/r/log_basic.result 2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/log_basic.result 2008-09-20 14:46:25 +0000
@@ -5,8 +5,8 @@ INIT_VALUE
SELECT @@log AS INIT_VALUE;
INIT_VALUE
1
-SET @@global.log = ON;
-SET global log = 0;
+SET @@global.general_log = ON;
+SET global general_log = 0;
'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
'#--------------------FN_DYNVARS_062_02-------------------------#'
=== modified file 'mysql-test/r/log_state.result'
--- a/mysql-test/r/log_state.result 2008-03-28 18:46:18 +0000
+++ b/mysql-test/r/log_state.result 2008-09-20 14:46:25 +0000
@@ -187,6 +187,8 @@ SELECT @@general_log, @@log;
@@general_log @@log
1 1
SET GLOBAL log = 0;
+Warnings:
+Warning 1287 The syntax 'log' is deprecated and will be removed in MySQL 7.0. Please use
'general_log' instead
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log OFF
@@ -216,6 +218,8 @@ SELECT @@slow_query_log, @@log_slow_quer
@@slow_query_log @@log_slow_queries
0 0
SET GLOBAL log_slow_queries = 0;
+Warnings:
+Warning 1287 The syntax 'log_slow_queries' is deprecated and will be removed in MySQL
7.0. Please use 'slow_query_log' instead
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log OFF
@@ -270,4 +274,28 @@ SET GLOBAL general_log_file = @general_l
SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
# -- End of Bug#32748.
+deprecated:
+SET GLOBAL log = 0;
+Warnings:
+Warning 1287 The syntax 'log' is deprecated and will be removed in MySQL 7.0. Please use
'general_log' instead
+SET GLOBAL log_slow_queries = 0;
+Warnings:
+Warning 1287 The syntax 'log_slow_queries' is deprecated and will be removed in MySQL
7.0. Please use 'slow_query_log' instead
+SET GLOBAL log = DEFAULT;
+Warnings:
+Warning 1287 The syntax 'log' is deprecated and will be removed in MySQL 7.0. Please use
'general_log' instead
+SET GLOBAL log_slow_queries = DEFAULT;
+Warnings:
+Warning 1287 The syntax 'log_slow_queries' is deprecated and will be removed in MySQL
7.0. Please use 'slow_query_log' instead
+not deprecated:
+SELECT @@global.general_log_file INTO @my_glf;
+SELECT @@global.slow_query_log_file INTO @my_sqlf;
+SET GLOBAL general_log = 0;
+SET GLOBAL slow_query_log = 0;
+SET GLOBAL general_log_file = 'WL4403_G.log';
+SET GLOBAL slow_query_log_file = 'WL4403_SQ.log';
+SET GLOBAL general_log_file = @my_glf;
+SET GLOBAL slow_query_log_file = @my_sqlf;
+SET GLOBAL general_log = DEFAULT;
+SET GLOBAL slow_query_log = DEFAULT;
End of 5.1 tests
=== modified file 'mysql-test/t/log_basic.test'
--- a/mysql-test/t/log_basic.test 2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/log_basic.test 2008-09-20 14:46:25 +0000
@@ -38,9 +38,9 @@ SELECT @@global.log AS INIT_VALUE;
SELECT @@log AS INIT_VALUE;
-SET @@global.log = ON;
+SET @@global.general_log = ON;
-SET global log = 0;
+SET global general_log = 0;
--echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
--echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
=== modified file 'mysql-test/t/log_state.test'
--- a/mysql-test/t/log_state.test 2008-03-28 18:46:18 +0000
+++ b/mysql-test/t/log_state.test 2008-09-20 14:46:25 +0000
@@ -259,6 +259,32 @@ SET GLOBAL slow_query_log_file = @slow_q
###########################################################################
+
+
+## WL#4403 - deprecate @log and @slow_log_queries variables
+
+## these are all deprecated -- show for command-line as well!
+--echo deprecated:
+SET GLOBAL log = 0;
+SET GLOBAL log_slow_queries = 0;
+SET GLOBAL log = DEFAULT;
+SET GLOBAL log_slow_queries = DEFAULT;
+
+## these are NOT deprecated
+--echo not deprecated:
+SELECT @@global.general_log_file INTO @my_glf;
+SELECT @@global.slow_query_log_file INTO @my_sqlf;
+SET GLOBAL general_log = 0;
+SET GLOBAL slow_query_log = 0;
+SET GLOBAL general_log_file = 'WL4403_G.log';
+SET GLOBAL slow_query_log_file = 'WL4403_SQ.log';
+SET GLOBAL general_log_file = @my_glf;
+SET GLOBAL slow_query_log_file = @my_sqlf;
+SET GLOBAL general_log = DEFAULT;
+SET GLOBAL slow_query_log = DEFAULT;
+
+
+
--echo End of 5.1 tests
--enable_ps_protocol
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2008-08-26 09:31:17 +0000
+++ b/sql/mysqld.cc 2008-09-20 14:46:25 +0000
@@ -5536,7 +5536,9 @@ enum options_mysqld
OPT_MIN_EXAMINED_ROW_LIMIT,
OPT_LOG_SLOW_SLAVE_STATEMENTS,
OPT_OLD_MODE,
- OPT_SLAVE_EXEC_MODE
+ OPT_SLAVE_EXEC_MODE,
+ OPT_GENERAL_LOG_FILE,
+ OPT_SLOW_QUERY_LOG_FILE
};
@@ -5769,8 +5771,12 @@ Disable with --skip-large-pages.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
+ /* --log is deprecated (7.0) in favour of --general-log-file */
{"log", 'l', "Log connections and queries to file.", (uchar**) &opt_logname,
(uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"general-log-file", OPT_GENERAL_LOG_FILE,
+ "Log connections and queries to given file.", (uchar**) &opt_logname,
+ (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
"Log update queries in binary format. Optional (but strongly recommended "
"to avoid replication problems if server's hostname changes) argument "
@@ -5848,6 +5854,10 @@ Disable with --skip-large-pages.",
"Log slow queries to a table or log file. Defaults logging to table mysql.slow_log or
hostname-slow.log if --log-output=file is used. Must be enabled to activate other slow log
options.",
(uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
+ {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE,
+ "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be
enabled to activate other slow log options.",
+ (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"log-tc", OPT_LOG_TC,
"Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled)",
@@ -7655,6 +7665,9 @@ mysqld_get_one_option(int optid,
default_collation_name= 0;
break;
case 'l':
+ WARN_DEPRECATED(NULL, "7.0", "log", "'general-log'/'general-log-file'");
+ /* FALL-THROUGH */
+ case OPT_GENERAL_LOG_FILE:
opt_log=1;
break;
case 'h':
@@ -7824,6 +7837,9 @@ mysqld_get_one_option(int optid,
}
#endif /* HAVE_REPLICATION */
case (int) OPT_SLOW_QUERY_LOG:
+ WARN_DEPRECATED(NULL, "7.0", "log-slow-queries",
"'slow-query-log'/'slow-query-log-file'");
+ /* FALL-THROUGH */
+ case (int) OPT_SLOW_QUERY_LOG_FILE:
opt_slow_log= 1;
break;
#ifdef WITH_CSV_STORAGE_ENGINE
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2008-09-09 10:19:31 +0000
+++ b/sql/set_var.cc 2008-09-20 14:46:25 +0000
@@ -2391,6 +2391,12 @@ end:
bool sys_var_log_state::update(THD *thd, set_var *var)
{
bool res;
+
+ if (this == &sys_var_log)
+ WARN_DEPRECATED(thd, "7.0", "log", "'general_log'");
+ else if (this == &sys_var_log_slow)
+ WARN_DEPRECATED(thd, "7.0", "log_slow_queries", "'slow_query_log'");
+
pthread_mutex_lock(&LOCK_global_system_variables);
if (!var->save_result.ulong_value)
{
@@ -2405,6 +2411,11 @@ bool sys_var_log_state::update(THD *thd,
void sys_var_log_state::set_default(THD *thd, enum_var_type type)
{
+ if (this == &sys_var_log)
+ WARN_DEPRECATED(thd, "7.0", "log", "'general_log'");
+ else if (this == &sys_var_log_slow)
+ WARN_DEPRECATED(thd, "7.0", "log_slow_queries", "'slow_query_log'");
+
pthread_mutex_lock(&LOCK_global_system_variables);
logger.deactivate_log_handler(thd, log_type);
pthread_mutex_unlock(&LOCK_global_system_variables);