summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-03-05 10:58:05 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-03-05 10:58:05 +0530
commit43903745e5af676db1fe813ab8e2ba7190353f83 (patch)
tree4426a992724806500ed517fd4124141fb21222ea /sql/item_subselect.h
parent6b8173b6e97f14509f54c908ae0a714eb6ac1316 (diff)
downloadmariadb-git-43903745e5af676db1fe813ab8e2ba7190353f83.tar.gz
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
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h8
1 files changed, 8 insertions, 0 deletions
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);
/*