diff options
author | unknown <kaa@polly.(none)> | 2007-10-25 14:02:27 +0400 |
---|---|---|
committer | unknown <kaa@polly.(none)> | 2007-10-25 14:02:27 +0400 |
commit | 6eced1b857b8df12079603cc18b716a92e69817f (patch) | |
tree | 2bbc9808fa3a3f2dbfa9993083319ad0074aa70f /mysql-test/r/variables.result | |
parent | 04311fabaa11105743ce124de283cd504c978cc4 (diff) | |
download | mariadb-git-6eced1b857b8df12079603cc18b716a92e69817f.tar.gz |
Fix for bug #29131: SHOW VARIABLES reports variable 'log' but SET
doesn't recognize it
This is a 5.0 version of the patch, it will be null-merged to 5.1
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:
Make 'log' and 'log_slow_queries' read-only dynamic variables to make
them available for use in expressions, and produce a correct error
about the variable being read-only when used in the SET statement.
mysql-test/r/variables.result:
Added a test case for bug #29131.
mysql-test/t/variables.test:
Added a test case for bug #29131.
sql/mysql_priv.h:
Changed the type of opt_log and opt_slow_log to my_bool to
align with the interfaces in set_var.cc
sql/mysqld.cc:
Changed the type of opt_log and opt_slow_log to my_bool to
align with the interfaces in set_var.cc
sql/set_var.cc:
Made 'log' and 'log_slow_queries' to be read-only dynamic system
variable, i.e. available for use in expressions with the @@var syntax.
sql/set_var.h:
Added a new system variable class representing a read-only boolean
variable.
Diffstat (limited to 'mysql-test/r/variables.result')
-rw-r--r-- | mysql-test/r/variables.result | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 3d76f8e4a90..217be9400e6 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -791,6 +791,22 @@ ERROR HY000: Variable 'hostname' is a read only variable show variables like 'hostname'; Variable_name Value hostname # +SHOW VARIABLES LIKE 'log'; +Variable_name Value +log ON +SELECT @@log; +@@log +1 +SET GLOBAL log=0; +ERROR HY000: Variable 'log' is a read only variable +SHOW VARIABLES LIKE 'log_slow_queries'; +Variable_name Value +log_slow_queries ON +SELECT @@log_slow_queries; +@@log_slow_queries +1 +SET GLOBAL log_slow_queries=0; +ERROR HY000: Variable 'log_slow_queries' is a read only variable End of 5.0 tests set global binlog_cache_size =@my_binlog_cache_size; set global connect_timeout =@my_connect_timeout; |