• Sergei Petrunia's avatar
    MDEV-25994: Crash with union of my_decimal type in ORDER BY clause · 3c209bfc
    Sergei Petrunia authored
    When single-row subquery fails with "Subquery reutrns more than 1 row"
    error, it will raise an error and return NULL.
    
    On the other hand, Item_singlerow_subselect sets item->maybe_null=0
    for table-less subqueries like "(SELECT not_null_value)"  (*)
    
    This discrepancy (item with maybe_null=0 returning NULL) causes the
    code in Type_handler_decimal_result::make_sort_key_part() to crash.
    
    Fixed this by allowing inference (*) only when the subquery is NOT a
    UNION.
    3c209bfc
subselect_no_mat.result 251 KB