summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index d3f933dc13f..2ee6de97ad0 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2090,6 +2090,12 @@ bool Item_field::val_bool_result()
}
+bool Item_field::is_null_result()
+{
+ return (null_value=result_field->is_null());
+}
+
+
bool Item_field::eq(const Item *item, bool binary_cmp) const
{
Item *real_item= ((Item *) item)->real_item();
@@ -5800,6 +5806,15 @@ double Item_ref::val_result()
}
+bool Item_ref::is_null_result()
+{
+ if (result_field)
+ return (null_value=result_field->is_null());
+
+ return is_null();
+}
+
+
longlong Item_ref::val_int_result()
{
if (result_field)
@@ -5905,7 +5920,9 @@ String *Item_ref::val_str(String* tmp)
bool Item_ref::is_null()
{
DBUG_ASSERT(fixed);
- return (*ref)->is_null();
+ bool tmp=(*ref)->is_null_result();
+ null_value=(*ref)->null_value;
+ return tmp;
}