diff options
author | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-05-27 18:42:28 +0700 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-05-27 18:42:28 +0700 |
commit | 3b58613275b07e598f713d71ebfffa02262af6b7 (patch) | |
tree | c1f9ac889f06425764a59c638f9df97659d53aba /sql/event_db_repository.cc | |
parent | c111ca4e523baf239618ec093300047a68a89fbd (diff) | |
parent | 8bb8385f02d36c6ca31ec2036876d891d56134b5 (diff) | |
download | mariadb-git-3b58613275b07e598f713d71ebfffa02262af6b7.tar.gz |
Manual-merge of patch for bug#12546938 from mysql-5.1->mysql-5.5
Diffstat (limited to 'sql/event_db_repository.cc')
-rw-r--r-- | sql/event_db_repository.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 75d1c8ef8e8..9d52627fa83 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -620,18 +620,21 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type, only creates a record on disk. @pre The thread handle has no open tables. - @param[in,out] thd THD - @param[in] parse_data Parsed event definition - @param[in] create_if_not TRUE if IF NOT EXISTS clause was provided - to CREATE EVENT statement - + @param[in,out] thd THD + @param[in] parse_data Parsed event definition + @param[in] create_if_not TRUE if IF NOT EXISTS clause was provided + to CREATE EVENT statement + @param[out] event_already_exists When method is completed successfully + set to true if event already exists else + set to false @retval FALSE success @retval TRUE error */ bool Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, - my_bool create_if_not) + bool create_if_not, + bool *event_already_exists) { int ret= 1; TABLE *table= NULL; @@ -663,6 +666,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, { if (create_if_not) { + *event_already_exists= true; push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_EVENT_ALREADY_EXISTS, ER(ER_EVENT_ALREADY_EXISTS), parse_data->name.str); @@ -670,8 +674,10 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, } else my_error(ER_EVENT_ALREADY_EXISTS, MYF(0), parse_data->name.str); + goto end; - } + } else + *event_already_exists= false; DBUG_PRINT("info", ("non-existent, go forward")); |