diff options
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 4f3c85fea62..ec3b44dc96c 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -146,6 +146,11 @@ public: eliminated= FALSE; null_value= 1; } + /** + Set the subquery result to the default value for the predicate when the + subquery is known to produce an empty result. + */ + void no_rows_in_result()= 0; virtual bool select_transformer(JOIN *join); bool assigned() { return value_assigned; } void assigned(bool a) { value_assigned= a; } @@ -262,6 +267,7 @@ public: subs_type substype() { return SINGLEROW_SUBS; } void reset(); + void no_rows_in_result() { reset(); make_const(); } bool select_transformer(JOIN *join); void store(uint i, Item* item); double val_real(); @@ -314,6 +320,7 @@ public: bool any_value() { return was_values; } void register_value() { was_values= TRUE; } void reset_value_registration() { was_values= FALSE; } + void no_rows_in_result(); }; /* exists subselect */ @@ -335,6 +342,7 @@ public: eliminated= FALSE; value= 0; } + void no_rows_in_result(); enum Item_result result_type() const { return INT_RESULT;} longlong val_int(); @@ -664,6 +672,7 @@ public: virtual void print(String *str, enum_query_type query_type); bool is_maxmin_applicable(JOIN *join); bool transform_into_max_min(JOIN *join); + void no_rows_in_result(); }; |