summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-07-16 03:29:13 +0400
committerkonstantin@mysql.com <>2005-07-16 03:29:13 +0400
commite08caeeee2b6250d4e4adfed34c99de08eaacecc (patch)
tree7b2a374b6d05a129d4b7e3e16593f7244bdccf90 /sql/item_func.h
parent0298bc347aad0ad0ed0083781d84d412a921459d (diff)
downloadmariadb-git-e08caeeee2b6250d4e4adfed34c99de08eaacecc.tar.gz
A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item to handle system variables. This item substitutes itself with a basic constant containing variable value at fix_fields.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 6b6e5d4b8ec..5e36f9863bb 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -988,6 +988,29 @@ public:
};
+/* A system variable */
+
+class Item_func_get_system_var :public Item_func
+{
+ sys_var *var;
+ enum_var_type var_type;
+ LEX_STRING component;
+public:
+ Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
+ LEX_STRING *component_arg, const char *name_arg,
+ size_t name_len_arg);
+ bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref);
+ /*
+ Stubs for pure virtual methods. Should never be called: this
+ item is always substituted with a constant in fix_fields().
+ */
+ double val() { DBUG_ASSERT(0); return 0.0; }
+ longlong val_int() { DBUG_ASSERT(0); return 0; }
+ String* val_str(String*) { DBUG_ASSERT(0); return 0; }
+ void fix_length_and_dec() { DBUG_ASSERT(0); }
+};
+
+
class Item_func_inet_aton : public Item_int_func
{
public: