• Oleksandr Byelkin's avatar
    MDEV-26009 Server crash when calling twice procedure using FOR-loop · fbc1cc97
    Oleksandr Byelkin authored
    The problem was that instructions sp_instr_cursor_copy_struct and
    sp_instr_copen uses the same lex, adding and removing "tail" of
    prelocked tables and forgetting that tail of all tables is kept in
    LEX::query_tables_last. If the LEX used only by one instruction
    or the query do not have prelocked tables it is not important.
    But to work correctly in all cases LEX::query_tables_last should
    be reset to make new tables added in the correct list (after last
    table in the LEX instead after last table of the prelocking "tail"
    which was cut).
    fbc1cc97
sp-cursor.result 14.7 KB