summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-06-11 17:07:33 +0200
committerunknown <guilhem@mysql.com>2003-06-11 17:07:33 +0200
commitb7e0c11a272b52c8a9c2b84d13bd9622c7dcf4b2 (patch)
tree4b8adcbf6de30c4e11830d69086c10983aeefc45 /sql/set_var.cc
parent0826127b2b826871fb3dcf1a1497d364d62da3b9 (diff)
downloadmariadb-git-b7e0c11a272b52c8a9c2b84d13bd9622c7dcf4b2.tar.gz
We now require SUPER privilege for SET PSEUDO_THREAD_ID.
mysql-test/r/rpl_temporary.result: result update mysql-test/t/rpl_temporary.test: test that PSEUDO_THREAD_ID now requires SUPER. sql/set_var.cc: Class for pseudo_thread_id (it used to be sys_var_thd_ulong, but we decided to require the SUPER privilege so we needed a check() function, which sys_var_thd_ulong does not feature (check() is virtual in sys_var and in sys_var_thd_ulong too). sql/set_var.h: Class for pseudo_thread_id
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index ad3966f76f9..a5377d8ebc6 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -168,7 +168,11 @@ sys_var_thd_ulong sys_max_error_count("max_error_count",
&SV::max_error_count);
sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size",
&SV::max_heap_table_size);
-sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id",
+/*
+ sys_pseudo_thread_id has its own class (instead of sys_var_thd_ulong) because
+ we want a check() function.
+*/
+sys_var_pseudo_thread_id sys_pseudo_thread_id("pseudo_thread_id",
&SV::pseudo_thread_id);
sys_var_thd_ha_rows sys_max_join_size("max_join_size",
&SV::max_join_size,
@@ -1454,6 +1458,17 @@ byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type)
return (byte*) &thd->current_insert_id;
}
+bool sys_var_pseudo_thread_id::check(THD *thd, set_var *var)
+{
+ if (thd->master_access & SUPER_ACL)
+ return 0;
+ else
+ {
+ my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
+ return 1;
+ }
+}
+
#ifdef HAVE_REPLICATION
bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)