mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
5.5-merge
This commit is contained in:
@ -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,¬_used);
|
||||
}
|
||||
last_executed_changed= FALSE;
|
||||
|
||||
if ((ptr= get_field(&mem_root, table->field[ET_FIELD_STATUS])) == NullS)
|
||||
DBUG_RETURN(TRUE);
|
||||
@ -934,7 +932,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;
|
||||
}
|
||||
@ -954,7 +951,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;
|
||||
}
|
||||
@ -1017,7 +1013,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
|
||||
{
|
||||
@ -1107,7 +1102,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;
|
||||
}
|
||||
@ -1143,50 +1137,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,
|
||||
@ -1524,7 +1479,7 @@ end:
|
||||
thd->end_statement();
|
||||
thd->cleanup_after_query();
|
||||
/* Avoid races with SHOW PROCESSLIST */
|
||||
thd->set_query(NULL, 0);
|
||||
thd->reset_query();
|
||||
|
||||
DBUG_PRINT("info", ("EXECUTED %s.%s ret: %d", dbname.str, name.str, ret));
|
||||
|
||||
|
Reference in New Issue
Block a user