diff options
author | unknown <kaa@polly.(none)> | 2007-10-25 14:03:24 +0400 |
---|---|---|
committer | unknown <kaa@polly.(none)> | 2007-10-25 14:03:24 +0400 |
commit | 974201c7e041193428d83e8a90f67adc9d1fd201 (patch) | |
tree | c6a9bd2bf6abe12e4bce92168d57189e690dd5e0 /mysql-test/r/log_state.result | |
parent | e259d46103f743de343c78e4a88b13ebd274e05a (diff) | |
download | mariadb-git-974201c7e041193428d83e8a90f67adc9d1fd201.tar.gz |
Fix for bug #29131: SHOW VARIABLES reports variable 'log' but SET
doesn't recognize it
This is a 5.1 version of the patch.
Problem:
'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
in SHOW VARIABLES, but could not be used in expressions like
"select @@log". Also, using them in the SET statement produced an
incorrect "unknown system variable" error.
Solution:
Since as of MySQL 5.1.12 one can enable or disable the general query log
or the slow query log at runtime by changing values of
general_log/slow_query_log, make 'log' and 'log_slow_queries" to be
synonyms for 'general_log' and 'slow_query_log' respectively. This
makes expressions using the '@@var' syntax backward compatible with
5.0 and SHOW VARIABLES output to be consistent with the SET statement.
mysql-test/r/log_state.result:
Added a test case for bug #29131.
mysql-test/t/log_state.test:
Added a test case for bug #29131.
sql/set_var.cc:
Made the 'log' and 'log_slow_queries' system variables to be synonyms for 'general_log' and 'slow_query_log'.
Diffstat (limited to 'mysql-test/r/log_state.result')
-rw-r--r-- | mysql-test/r/log_state.result | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result index 3a3ef584ce3..b0ec0d25935 100644 --- a/mysql-test/r/log_state.result +++ b/mysql-test/r/log_state.result @@ -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 |