diff options
author | unknown <malff/marcsql@weblab.(none)> | 2007-04-25 21:38:12 -0600 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2007-04-25 21:38:12 -0600 |
commit | 034c11f3cdac8b2b39dd8593d1fbad5b92f98879 (patch) | |
tree | f8e46975bbaed334eddc4cc2ab0c1b752a7b321d /sql/event_data_objects.cc | |
parent | 5e414cd222b1d39eb49371ba28fb990a963017c5 (diff) | |
download | mariadb-git-034c11f3cdac8b2b39dd8593d1fbad5b92f98879.tar.gz |
manual merge 5.0-runtime -> 5.1->runtime, with 25411 part I
Diffstat (limited to 'sql/event_data_objects.cc')
-rw-r--r-- | sql/event_data_objects.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index f5847e603e8..4b788a8f7d8 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -156,10 +156,14 @@ void Event_parse_data::init_body(THD *thd) { DBUG_ENTER("Event_parse_data::init_body"); + + /* This method is called from within the parser, from sql_yacc.yy */ + DBUG_ASSERT(thd->m_lip != NULL); + DBUG_PRINT("info", ("body: '%s' body_begin: 0x%lx end: 0x%lx", body_begin, - (long) body_begin, (long) thd->lex->ptr)); + (long) body_begin, (long) thd->m_lip->ptr)); - body.length= thd->lex->ptr - body_begin; + body.length= thd->m_lip->ptr - body_begin; const char *body_end= body_begin + body.length - 1; /* Trim nuls or close-comments ('*'+'/') or spaces at the end */ @@ -1912,15 +1916,20 @@ Event_job_data::execute(THD *thd, bool drop) thd->query= sp_sql.c_ptr_safe(); thd->query_length= sp_sql.length(); - lex_start(thd, thd->query, thd->query_length); - - if (MYSQLparse(thd) || thd->is_fatal_error) { - sql_print_error("Event Scheduler: " - "%serror during compilation of %s.%s", - thd->is_fatal_error ? "fatal " : "", - (const char *) dbname.str, (const char *) name.str); - goto end; + Lex_input_stream lip(thd, thd->query, thd->query_length); + thd->m_lip= &lip; + lex_start(thd); + int err= MYSQLparse(thd); + + if (err || thd->is_fatal_error) + { + sql_print_error("Event Scheduler: " + "%serror during compilation of %s.%s", + thd->is_fatal_error ? "fatal " : "", + (const char *) dbname.str, (const char *) name.str); + goto end; + } } { |