From 43903745e5af676db1fe813ab8e2ba7190353f83 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sun, 5 Mar 2017 10:58:05 +0530 Subject: MDEV-11078: NULL NOT IN (non-empty subquery) should never return results Disabling the cond guards during the creation of Tricond Item for constant and NULL left expression items --- sql/item_subselect.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sql/item_subselect.h') diff --git a/sql/item_subselect.h b/sql/item_subselect.h index a44503b4471..2f166c83e8f 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -596,6 +596,14 @@ public: void set_first_execution() { if (first_execution) first_execution= FALSE; } bool expr_cache_is_needed(THD *thd); inline bool left_expr_has_null(); + void disable_cond_guard_for_const_null_left_expr(int i) + { + if (left_expr->const_item() && !left_expr->is_expensive()) + { + if (left_expr->element_index(i)->is_null()) + set_cond_guard_var(i,FALSE); + } + } int optimize(double *out_rows, double *cost); /* -- cgit v1.2.1