diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-06-27 11:06:37 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-06-27 11:06:37 +0500 |
commit | 9ee3b4b7dd1190179dcc4185c780b464fe92680e (patch) | |
tree | 63c86103d2188137b241a56dc85ccba1ea6418df /sql/event_data_objects.cc | |
parent | 7a310d32344d97b265bfffdc89897b6727e45b97 (diff) | |
download | mariadb-git-9ee3b4b7dd1190179dcc4185c780b464fe92680e.tar.gz |
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
mysql-test/r/events_bugs.result:
Bug #29156 events crash server in test suite
test result added
mysql-test/t/events_bugs.test:
Bug #29156 events crash server in test suite
testcase
Diffstat (limited to 'sql/event_data_objects.cc')
-rw-r--r-- | sql/event_data_objects.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 77dc33e6265..5aca40d357a 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -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); |