mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fix for bug#16537 (Events: mysql.event.starts is null)
- now when the event is created and STARTS is omitted then STARTS is implicitly CURRENT_TIMESTAMP - This CS also fixed incorrect presentation of STARTS/ENDS in I_S.EVENTS (incorporated review changes) mysql-test/r/events.result: results of new test cases mysql-test/t/events.test: new test cases for bug #16537 (Events: mysql.event.starts is null) sql/event.cc: - check whether event_timed::starts_null only in case event_timed::expression is set, so for recurring events only - disable binlogging of CREATE EVENT statement. It should not be replicated but the result of the execution. Still the replication is untouched topic. sql/event.h: - add flags whether starts, ends and execute_at are null or not sql/event_executor.cc: - check whether xxx_null instead of !xxxx.year sql/event_timed.cc: - introduce xxx_null and change the usage of xxx.year to !xxx_null sql/sql_show.cc: - don't show 0000-00-00 in I_S.EVENTS when the value is NULL sql/sql_yacc.yy: - if STARTS is omitted default to current_timestamp
This commit is contained in:
@ -3883,35 +3883,32 @@ fill_events_copy_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
|
||||
{
|
||||
//type
|
||||
sch_table->field[5]->store(STRING_WITH_LEN("RECURRING"), scs);
|
||||
//execute_at
|
||||
sch_table->field[6]->set_null();
|
||||
//interval_value
|
||||
sch_table->field[7]->set_notnull();
|
||||
sch_table->field[7]->store((longlong) et.expression);
|
||||
|
||||
//interval_type
|
||||
LEX_STRING *ival=&interval_type_to_name[get_real_interval_type(et.interval)];
|
||||
sch_table->field[8]->set_notnull();
|
||||
sch_table->field[8]->store(ival->str, ival->length, scs);
|
||||
//starts & ends
|
||||
|
||||
//starts & ends
|
||||
sch_table->field[10]->set_notnull();
|
||||
sch_table->field[10]->store_time(&et.starts, MYSQL_TIMESTAMP_DATETIME);
|
||||
sch_table->field[11]->set_notnull();
|
||||
sch_table->field[11]->store_time(&et.ends, MYSQL_TIMESTAMP_DATETIME);
|
||||
|
||||
if (!et.ends_null)
|
||||
{
|
||||
sch_table->field[11]->set_notnull();
|
||||
sch_table->field[11]->store_time(&et.ends, MYSQL_TIMESTAMP_DATETIME);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//type
|
||||
sch_table->field[5]->store(STRING_WITH_LEN("ONE TIME"), scs);
|
||||
//execute_at
|
||||
|
||||
sch_table->field[6]->set_notnull();
|
||||
sch_table->field[6]->store_time(&et.execute_at, MYSQL_TIMESTAMP_DATETIME);
|
||||
//interval
|
||||
sch_table->field[7]->set_null();
|
||||
//interval_type
|
||||
sch_table->field[8]->set_null();
|
||||
//starts & ends
|
||||
sch_table->field[10]->set_null();
|
||||
sch_table->field[11]->set_null();
|
||||
}
|
||||
|
||||
//status
|
||||
|
Reference in New Issue
Block a user