• konstantin@mysql.com's avatar
    A fix and a test case for "Bug #12168 'DECLARE CONTINUE HANDLER FOR · 887fba47
    konstantin@mysql.com authored
    NOT FOUND ...' in conditional handled incorrectly".
    
    Whenever we remove an instruction during optimization, we need to
    adjust instruction numbers (ip - instruction pointer) stored in all
    instructions. In addition to that, sp_instr_hpush_jump, which 
    corresponds to DECLARE CONTINUE HANDLER needs adjustment for m_handler,
    which holds the number of instruction with the continue handler.
    In the bug report, a wrong ip stored in m_handler was pointing at 
    FETCH, which resulted in an error message and abnormal SP termination.
    The fix is to just remove m_handler member from sp_instr_hpush_jump,
    as it's always points to the instruction next to the DECLARE
    statement itself (m_ip+1).
    887fba47
sp.test 82.3 KB