• Dmitry Shulga's avatar
    MDEV-5816: Stored programs: validation of stored program statements · a957d2f8
    Dmitry Shulga authored
    Introduced the new data member new_query_arena_is_set of the class sp_head.
    This data member is used as a protection against double invocation of
    the method restore_thd_mem_root that is called for restoration of the
    current query arena. Previously, the data member sp_head::m_thd
    is used for this goal but after support for recompilation
    of failed stored routine statement has been added the data member
    sp_head::m_thd can't be used for this goal. The reason is that
    on statement recompilation after the method restore_thd_mem_root()
    is called the method sp_head::add_instr() invoked to add a new instruction
    for just recompiled statement. The method sp_head::add_instr()
    de-references m_thd to access the free_list data member.
    If m_thd was used as a guard against double invocation it would result in
    a crash on dereferncing null pointer.
    a957d2f8
sp_head.h 37.2 KB