• Igor Babaev's avatar
    MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT · 39feab3c
    Igor Babaev authored
    IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
    level select and this expression used a subquery with a column reference
    that could not be resolved then an attempt to resolve this reference as
    an outer reference caused a crash of the server. This happened because the
    outer context field in the Name_resolution_context structure was not set
    to NULL for such references. Rather it pointed to the first element in
    the select_stack.
    
    Note that starting from 10.4 we cannot use the SELECT_LEX::outer_select()
    method when parsing a SELECT construct.
    
    Approved by Oleksandr Byelkin <sanja@mariadb.com>
    39feab3c
sql_yacc.yy 554 KB