summaryrefslogtreecommitdiff
path: root/sql/set_var.h
diff options
context:
space:
mode:
authorkaa@polly.(none) <>2007-10-25 14:02:27 +0400
committerkaa@polly.(none) <>2007-10-25 14:02:27 +0400
commit99f4b74311c8e08446fb2db77e5ccc43d6d9af1d (patch)
tree2bbc9808fa3a3f2dbfa9993083319ad0074aa70f /sql/set_var.h
parent349841118f6e209faedc09e59282d6751706a06f (diff)
downloadmariadb-git-99f4b74311c8e08446fb2db77e5ccc43d6d9af1d.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.
Diffstat (limited to 'sql/set_var.h')
-rw-r--r--sql/set_var.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/set_var.h b/sql/set_var.h
index 6000e155db9..7b3f864f44c 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -160,6 +160,28 @@ public:
};
+class sys_var_bool_const_ptr : public sys_var
+{
+public:
+ my_bool *value;
+ sys_var_bool_const_ptr(const char *name_arg, my_bool *value_arg)
+ :sys_var(name_arg),value(value_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ bool update(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
+ byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (byte*) value; }
+ bool check_update_type(Item_result type) { return 0; }
+ bool is_readonly() const { return 1; }
+};
+
class sys_var_str :public sys_var
{
public: