diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 2a89c86cd88..b67639d70b2 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2041,6 +2041,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(); @@ -5629,6 +5635,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) @@ -5734,7 +5749,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; } |