• Dmitry Shulga's avatar
    MDEV-5816: Stored programs: validation of stored program statements · 6abc16cb
    Dmitry Shulga authored
    This patch fixes the issue with missing warnings generated on re-parsing
    a failing SP instruction's statement. That is, any warning generated
    on re-parsing a statement was discarded after a SP instruction's statement
    has been successfully re-parsed.
    
    The reason for discarding warnings after re-parsing is that the method
      THD::set_query_id()
    called every time when a failing SP instruction re-parsed.
    In result,
      Warning_info::m_warn_id != thd->query_id
    and when the method
      Diagnostics_area::opt_clear_warning_info(thd->query_id)
    is invoked from sp_head::execute all warnings accumulated during
    execution of the current SP instruction is cleared.
    
    So, to fix the issue invokes the method THD::set_query_id()
    once per SP instruction, on its first execution. Re-parsing of failing
    SP instruction and following run of it don't invoke the method
    THD::set_query_id().
    6abc16cb
sp_instr.cc 55.5 KB