• Sergei Petrunia's avatar
    MDEV-32324: Server crashes inside filesort at my_decimal::to_binary · 208ed0d8
    Sergei Petrunia authored
    A subquery in form "(SELECT not_null_value LIMIT 1 OFFSET 1)" will
    produce no rows which will translate into scalar SQL NULL value.
    
    The code in Item_singlerow_subselect::fix_length_and_dec() failed to
    take the LIMIT/OFFSET clause into account and used to set
    item_subselect->maybe_null=0, despite that SQL NULL will be produced.
    
    If such subselect was used in ORDER BY, this would cause a crash in
    filesort() code when it would get a NULL value for a not-nullable item.
    
    also made subselect_engine::no_tables() const function.
    208ed0d8
order_by.result 90.4 KB