summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-06-02 12:46:48 -0700
committerunknown <igor@olga.mysql.com>2007-06-02 12:46:48 -0700
commit8ff5607d940d933d9227625c8b4389dbce937612 (patch)
tree34335308566d05adbb552d7d3dc206f5f3d22e4e /sql
parentb7ce84adbbf7e2bb8f3deb83a8756cb815f747cc (diff)
parent7184a5921a07256570705ee6dad158c5e31c9c73 (diff)
downloadmariadb-git-8ff5607d940d933d9227625c8b4389dbce937612.tar.gz
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug28728
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc34
-rw-r--r--sql/item_func.h4
2 files changed, 38 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 95ff432ca5a..aa1d54b0ebd 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4208,6 +4208,40 @@ my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
}
+double Item_func_set_user_var::val_real_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_real(&null_value);
+}
+
+longlong Item_func_set_user_var::val_int_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_int(&null_value);
+}
+
+String *Item_func_set_user_var::val_str_result(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_str(&null_value, str, decimals);
+}
+
+
+my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_decimal(&null_value, val);
+}
+
+
void Item_func_set_user_var::print(String *str)
{
str->append(STRING_WITH_LEN("(@"));
diff --git a/sql/item_func.h b/sql/item_func.h
index 18cd87d2de4..c8ea79b9747 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1208,6 +1208,10 @@ public:
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
+ double val_real_result();
+ longlong val_int_result();
+ String *val_str_result(String *str);
+ my_decimal *val_decimal_result(my_decimal *);
bool update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
bool send(Protocol *protocol, String *str_arg);