• unknown's avatar
    Fix for yet another memleak caused by SP-locking patch. · c91cbe39
    unknown authored
    Improved handling of situations when we encounter error during
    CREATE PROCEDURE (FUNCTION/TRIGGER/...) and bail out of yyparse()
    without restoring proper THD::lex.
    
    
    sql/sp.cc:
      We do not need to call sp_head::restore_lex() explicitly to restore right
      value of THD::lex in case when we have encountered error during parsing.
      Now we do this in sp_head::~sp_head() instead.
    sql/sp_head.cc:
      sp_head::destroy():
       Fixed cleaning up of stack of auxilary LEXes. 
       We also restore right value of THD::lex during this process now.
    sql/sql_parse.cc:
      We do not need to call sp_head::restore_lex() explicitly to restore right
      value of THD::lex in case when we have encountered error during parsing.
      Now we do this in sp_head::~sp_head() instead.
    sql/sql_prepare.cc:
      We do not need to call sp_head::restore_lex() explicitly to restore right
      value of THD::lex in case when we have encountered error during parsing.
      Now we do this in sp_head::~sp_head() instead.
    sql/sql_trigger.cc:
      We do not need to call sp_head::restore_lex() explicitly to restore right
      value of THD::lex in case when we have encountered error during parsing.
      Now we do this in sp_head::~sp_head() instead.
    c91cbe39
sp.cc 34.2 KB