summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-08-26 14:34:56 +0300
committerbell@sanja.is.com.ua <>2004-08-26 14:34:56 +0300
commitb836d2ddb7d699b4e22f8bf91d4b5bb63b6159d2 (patch)
tree2273f9bdfcddb0c71834d3b66f8d49a434d27054 /sql/item.cc
parent8b01230e5b05858bc6a935957fa53b164c4a833f (diff)
downloadmariadb-git-b836d2ddb7d699b4e22f8bf91d4b5bb63b6159d2.tar.gz
fixed updateability VIEW detection (Bug#5146)
fixed other Item_ref methods where result_field involved
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 17e911cfbb9..138ab384caf 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2141,6 +2141,7 @@ void Item_ref::cleanup()
{
DBUG_ENTER("Item_ref::cleanup");
Item_ident::cleanup();
+ result_field= 0;
if (hook_ptr)
*hook_ptr= orig_item;
DBUG_VOID_RETURN;
@@ -2164,6 +2165,43 @@ bool Item_ref::send(Protocol *prot, String *tmp)
}
+double Item_ref::val_result()
+{
+ if (result_field)
+ {
+ if ((null_value= result_field->is_null()))
+ return 0.0;
+ return result_field->val_real();
+ }
+ return val();
+}
+
+
+longlong Item_ref::val_int_result()
+{
+ if (result_field)
+ {
+ if ((null_value= result_field->is_null()))
+ return 0.0;
+ return result_field->val_int();
+ }
+ return val_int();
+}
+
+
+String *Item_ref::str_result(String* str)
+{
+ if (result_field)
+ {
+ if ((null_value= result_field->is_null()))
+ return 0;
+ str->set_charset(str_value.charset());
+ return result_field->val_str(str, &str_value);
+ }
+ return val_str(str);
+}
+
+
void Item_ref_null_helper::print(String *str)
{
str->append("<ref_null_helper>(", 18);