• Sergei Golubchik's avatar
    MDEV-7339 Server crashes in Item_func_trig_cond::val_int · c5975eae
    Sergei Golubchik authored
    Item_in_subselect::pushed_cond_guards[] array is allocated only when
    left_expr->maybe_null. And it is used (for row expressions) when
    left_expr->element_index(i)->maybe_null.
    
    For left_expr being a multi-column subquery, its maybe_null is
    always false when the subquery doesn't use tables (see
    Item_singlerow_subselect::fix_length_and_dec()
    and subselect_single_select_engine::fix_length_and_dec()),
    otherwise it's always true.
    
    But row elements can be NULL regardless, so let's always allocate
    pushed_cond_guards for multi-column subqueries, no matter whether
    its maybe_null was forced to true or false.
    c5975eae
subselect_nulls.test 2.24 KB