diff options
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sql/events.cc b/sql/events.cc index 1820b594555..6eaa27b3212 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2011, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -321,7 +321,6 @@ common_1_lev_code: case INTERVAL_MICROSECOND: my_error(ER_NOT_SUPPORTED_YET, MYF(0), "MICROSECOND"); return 1; - break; case INTERVAL_QUARTER: expr/= 3; close_quote= FALSE; @@ -457,8 +456,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, parse_data->name, new_element))) { - if (!db_repository->drop_event(thd, parse_data->dbname, parse_data->name, - TRUE)) + if (!db_repository->drop_event(thd, parse_data->dbname, + parse_data->name, TRUE)) dropped= 1; delete new_element; } @@ -480,16 +479,19 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, String log_query; if (create_query_string(thd, &log_query)) { - sql_print_error("Event Error: An error occurred while creating query string, " - "before writing it into binary log."); + sql_print_error("Event Error: An error occurred while creating query " + "string, before writing it into binary log."); ret= true; } else + { /* - If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER - will be written into the binary log as the definer for the SQL thread. + If the definer is not set or set to CURRENT_USER, the value + of CURRENT_USER will be written into the binary log as the + definer for the SQL thread. */ ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length()); + } } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -757,8 +759,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol) field_list.push_back(new Item_empty_string("Event", NAME_CHAR_LEN)); - if (sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode, - &sql_mode)) + if (sys_var::make_set(thd, et->sql_mode, &sql_mode_typelib, &sql_mode)) DBUG_RETURN(TRUE); field_list.push_back(new Item_empty_string("sql_mode", (uint) sql_mode.length)); @@ -1066,7 +1067,12 @@ Events::deinit() void Events::init_mutexes() { - pthread_mutex_init(&LOCK_event_metadata, MY_MUTEX_INIT_FAST); + /* + Inconsisent usage between LOCK_event_metadata and LOCK_scheduler_state + and LOCK_open + */ + my_pthread_mutex_init(&LOCK_event_metadata, MY_MUTEX_INIT_FAST, + "LOCK_event_metadata", MYF_NO_DEADLOCK_DETECTION); } @@ -1270,8 +1276,9 @@ Events::load_events_from_db(THD *thd) } } } - sql_print_information("Event Scheduler: Loaded %d event%s", - count, (count == 1) ? "" : "s"); + if (global_system_variables.log_warnings) + sql_print_information("Event Scheduler: Loaded %d event%s", + count, (count == 1) ? "" : "s"); ret= FALSE; end: |