1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge from mysql-5.5-runtime to mysql-5.5-bugteam

No conflicts
This commit is contained in:
Jon Olav Hauglid
2010-11-18 16:01:58 +01:00
95 changed files with 6696 additions and 1876 deletions

View File

@ -290,7 +290,6 @@ Event_basic::load_time_zone(THD *thd, const LEX_STRING tz_name)
*/
Event_queue_element::Event_queue_element():
status_changed(FALSE), last_executed_changed(FALSE),
on_completion(Event_parse_data::ON_COMPLETION_DROP),
status(Event_parse_data::ENABLED), expression(0), dropped(FALSE),
execution_count(0)
@ -539,7 +538,6 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
TIME_NO_ZERO_DATE);
last_executed= my_tz_OFFSET0->TIME_to_gmt_sec(&time,&not_used);
}
last_executed_changed= FALSE;
if ((ptr= get_field(&mem_root, table->field[ET_FIELD_STATUS])) == NullS)
DBUG_RETURN(TRUE);
@ -935,7 +933,6 @@ Event_queue_element::compute_next_execution_time()
DBUG_PRINT("info",("One-time event will be dropped: %d.", dropped));
status= Event_parse_data::DISABLED;
status_changed= TRUE;
}
goto ret;
}
@ -955,7 +952,6 @@ Event_queue_element::compute_next_execution_time()
dropped= TRUE;
DBUG_PRINT("info", ("Dropped: %d", dropped));
status= Event_parse_data::DISABLED;
status_changed= TRUE;
goto ret;
}
@ -1018,7 +1014,6 @@ Event_queue_element::compute_next_execution_time()
if (on_completion == Event_parse_data::ON_COMPLETION_DROP)
dropped= TRUE;
status= Event_parse_data::DISABLED;
status_changed= TRUE;
}
else
{
@ -1108,7 +1103,6 @@ Event_queue_element::compute_next_execution_time()
execute_at= 0;
execute_at_null= TRUE;
status= Event_parse_data::DISABLED;
status_changed= TRUE;
if (on_completion == Event_parse_data::ON_COMPLETION_DROP)
dropped= TRUE;
}
@ -1144,50 +1138,11 @@ void
Event_queue_element::mark_last_executed(THD *thd)
{
last_executed= (my_time_t) thd->query_start();
last_executed_changed= TRUE;
execution_count++;
}
/*
Saves status and last_executed_at to the disk if changed.
SYNOPSIS
Event_queue_element::update_timing_fields()
thd - thread context
RETURN VALUE
FALSE OK
TRUE Error while opening mysql.event for writing or during
write on disk
*/
bool
Event_queue_element::update_timing_fields(THD *thd)
{
Event_db_repository *db_repository= Events::get_db_repository();
int ret;
DBUG_ENTER("Event_queue_element::update_timing_fields");
DBUG_PRINT("enter", ("name: %*s", (int) name.length, name.str));
/* No need to update if nothing has changed */
if (!(status_changed || last_executed_changed))
DBUG_RETURN(0);
ret= db_repository->update_timing_fields_for_event(thd,
dbname, name,
last_executed_changed,
last_executed,
status_changed,
(ulonglong) status);
last_executed_changed= status_changed= FALSE;
DBUG_RETURN(ret);
}
static
void
append_datetime(String *buf, Time_zone *time_zone, my_time_t secs,