From 5a10f1ac96bc1cfa2513047e852f5bb3ef7cb627 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Aug 2004 12:59:06 +0200 Subject: [PATCH] Fixed a valgrind warning when creating stored procedures containing complex unions (crashed randomly), and made "label" not a reserved word. sql/sql_parse.cc: Fixed valgrind warning for certain complex unions (which sometime caused crash). sql/sql_yacc.yy: The temporary(?) "label" statement should not be a reserved word. --- sql/sql_parse.cc | 4 ++++ sql/sql_yacc.yy | 1 + 2 files changed, 5 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 21d2a51bfeb..58385c67493 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3584,21 +3584,25 @@ purposes internal to the MySQL server", MYF(0)); switch (res) { case SP_OK: send_ok(thd); + lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; break; case SP_WRITE_ROW_FAILED: net_printf(thd, ER_SP_ALREADY_EXISTS, SP_TYPE_STRING(lex), name); + lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; goto error; case SP_NO_DB_ERROR: net_printf(thd, ER_BAD_DB_ERROR, lex->sphead->m_db.str); + lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; goto error; default: net_printf(thd, ER_SP_STORE_FAILED, SP_TYPE_STRING(lex), name); + lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; goto error; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 498fb1b7fcf..ec9c921f5cb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6573,6 +6573,7 @@ keyword: | INNOBASE_SYM {} | INSERT_METHOD {} | RELAY_THREAD {} + | LABEL_SYM {} | LANGUAGE_SYM {} | LAST_SYM {} | LEAVES {}