• unknown's avatar
    Fixed BUG#15737: Stored procedure optimizer bug with LEAVE · f89389e3
    unknown authored
      Second version.
      The problem was that the optimizer didn't work correctly with forwards jumps
      to "no-op" hpop and cpop instructions.
      Don't generate "no-op" instructions (hpop 0 and cpop 0), it isn't actually
      necessary.
    
    
    mysql-test/r/sp-code.result:
      Updated results for new test case (BUG#15737)
    mysql-test/t/sp-code.test:
      New test case (BUG#15737)
    sql/sp_head.cc:
      Removed backpatch methods from sp_instr_hpop/cpop, since they're not needed any more.
      Added more documentation to sp_head::optimize()
    sql/sp_head.h:
      Removed backpatch and opt_mark methods from sp_instr_hpop/cpop, since they're not needed
      any more.
      Added comments to optimizer methods in sp_instr.
    sql/sql_yacc.yy:
      Don't generate "no-op" hpop and cpop instructions for LEAVE, it's not necessary.
      Just generate them when needed.
    f89389e3
sql_yacc.yy 234 KB