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
This commit is contained in:
Varun Gupta 2017-03-05 10:58:05 +05:30
commit 43903745e5
4 changed files with 68 additions and 0 deletions

View file

@ -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);
/*