1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #29156 events crash server in test suite

don't free thd->lex->sphead if we didn't do lex_start(),
as we can have garbage there
This commit is contained in:
holyfoot/hf@mysql.com/hfmain.(none)
2007-06-27 11:06:37 +05:00
parent 0d7168602d
commit 8f7cc6997a
3 changed files with 114 additions and 8 deletions

View File

@ -1778,7 +1778,7 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"failed to authenticate the user.",
definer.str, dbname.str, name.str);
goto end;
goto end_no_lex_start;
}
#endif
@ -1795,11 +1795,11 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"user no longer has EVENT privilege.",
definer.str, dbname.str, name.str);
goto end;
goto end_no_lex_start;
}
if (construct_sp_sql(thd, &sp_sql))
goto end;
goto end_no_lex_start;
/*
Set up global thread attributes to reflect the properties of
@ -1860,6 +1860,13 @@ Event_job_data::execute(THD *thd, bool drop)
}
end:
if (thd->lex->sphead) /* NULL only if a parse error */
{
delete thd->lex->sphead;
thd->lex->sphead= NULL;
}
end_no_lex_start:
if (drop && !thd->is_fatal_error)
{
/*
@ -1887,11 +1894,6 @@ end:
ret= 1;
}
}
if (thd->lex->sphead) /* NULL only if a parse error */
{
delete thd->lex->sphead;
thd->lex->sphead= NULL;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (save_sctx)
event_sctx.restore_security_context(thd, save_sctx);