Commit a06ff976 authored by unknown's avatar unknown

A fix for events_trans.test failure on many hosts (5.1-runtime)


sql/event_data_objects.cc:
  Disable an event if its data in the table is corrupted.
sql/events.cc:
  A fix for events_trans failure on most of the hosts.
  A better error message if the event table is old
  (don't suggest it's corrupted, it may simply have bad data).
parent 25677bdc
...@@ -1043,6 +1043,7 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table) ...@@ -1043,6 +1043,7 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
status = Event_queue_element::SLAVESIDE_DISABLED; status = Event_queue_element::SLAVESIDE_DISABLED;
break; break;
case 'D' : case 'D' :
default:
status = Event_queue_element::DISABLED; status = Event_queue_element::DISABLED;
break; break;
} }
......
...@@ -387,7 +387,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, ...@@ -387,7 +387,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
if (check_db_dir_existence(parse_data->dbname.str)) if (check_db_dir_existence(parse_data->dbname.str))
{ {
my_error(ER_BAD_DB_ERROR, MYF(0)); my_error(ER_BAD_DB_ERROR, MYF(0), parse_data->dbname.str);
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -508,7 +508,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, ...@@ -508,7 +508,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
/* Check that the target database exists */ /* Check that the target database exists */
if (check_db_dir_existence(new_dbname->str)) if (check_db_dir_existence(new_dbname->str))
{ {
my_error(ER_BAD_DB_ERROR, MYF(0)); my_error(ER_BAD_DB_ERROR, MYF(0), new_dbname->str);
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
} }
...@@ -1116,7 +1116,7 @@ Events::load_events_from_db(THD *thd) ...@@ -1116,7 +1116,7 @@ Events::load_events_from_db(THD *thd)
DBUG_ENTER("Events::load_events_from_db"); DBUG_ENTER("Events::load_events_from_db");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
if ((ret= db_repository->open_event_table(thd, TL_WRITE, &table))) if (db_repository->open_event_table(thd, TL_WRITE, &table))
{ {
sql_print_error("Event Scheduler: Failed to open table mysql.event"); sql_print_error("Event Scheduler: Failed to open table mysql.event");
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
...@@ -1137,8 +1137,8 @@ Events::load_events_from_db(THD *thd) ...@@ -1137,8 +1137,8 @@ Events::load_events_from_db(THD *thd)
if (et->load_from_row(thd, table)) if (et->load_from_row(thd, table))
{ {
sql_print_error("Event Scheduler: " sql_print_error("Event Scheduler: "
"Error while reading from mysql.event. " "Error while loading events from mysql.event. "
"The table is probably corrupted"); "The table probably contains bad data or is corrupted");
delete et; delete et;
goto end; goto end;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment