• unknown's avatar
    Fixed BUG#14498: Stored procedures: hang if undefined variable and exception · 84ac5c13
    unknown authored
      The problem was to continue at the right place in the code after the
      test expression in a flow control statement fails with an exception
      (internally, the test in sp_instr_jump_if_not), and the exception is
      caught by a continue handler. Execution must then be resumed after the
      the entire flow control statement (END IF, END WHILE, etc).
    
    
    mysql-test/r/sp.result:
      New test case for BUG#14498.
    mysql-test/t/sp.test:
      New test case for BUG#14498.
      (Note that one call is disabled at the moment. Depends on BUG#14643.)
    sql/sp_head.cc:
      Added a continuation destination for sp_instr_jump_if_not, for the case when
      an error in the test expression causes a continue handler to catch.
      This includes new members in sp_instr_jump_if_not, adjustment of the optmizer
      (mark and move methods), and separate backpatching code (since we can't use
      the normal one for this).
      
      Also removed the class sp_instr_jump, since it's never used.
      
      ...and added some comments to the optimizer.
    sql/sp_head.h:
      Added a continuation destination for sp_instr_jump_if_not, for the case when
      an error in the test expression causes a continue handler to catch.
      This includes new members in sp_instr_jump_if_not, adjustment of the optmizer
      (mark and move methods), and separate backpatching code (since we can't use
      the normal one for this).
      
      Also removed the class sp_instr_jump, since it's never used.
    sql/sql_yacc.yy:
      Added backpatching of the continue destination for all conditional statements
      (using sp_instr_jump_if_not).
    84ac5c13
sp.result 79.7 KB