diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2008-09-11 09:51:02 +0200 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2008-09-11 09:51:02 +0200 |
commit | 5de76e39e739f5a6fba20d0e5fe2ca9d7c300257 (patch) | |
tree | 931f430b93cea1fbc1007436206a910b19875c51 /sql/event_db_repository.cc | |
parent | 4b0ab1e0dcba69a64ce2d5197c957f0b7983d033 (diff) | |
parent | 4b317a5688420a7ff0ba438dbc0b5fe6393c673b (diff) | |
download | mariadb-git-5de76e39e739f5a6fba20d0e5fe2ca9d7c300257.tar.gz |
Bug#35981: ALTER EVENT causes the server to change the PRESERVE option.
If [NOT] PRESERVE was not given, parser always defaulted to NOT
PRESERVE, making it impossible for the "not given = no change"
rule to work in ALTER EVENT. Leaving out the PRESERVE-clause
defaults to NOT PRESERVE on CREATE now, and to "no change" in
ALTER.
Diffstat (limited to 'sql/event_db_repository.cc')
-rw-r--r-- | sql/event_db_repository.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 382fd024aa8..68de5962e46 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -185,6 +185,8 @@ mysql_event_fill_row(THD *thd, DBUG_PRINT("info", ("dbname=[%s]", et->dbname.str)); DBUG_PRINT("info", ("name =[%s]", et->name.str)); + DBUG_ASSERT(et->on_completion != Event_parse_data::ON_COMPLETION_DEFAULT); + if (table->s->fields < ET_FIELD_COUNT) { /* @@ -745,6 +747,18 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, store_record(table,record[1]); + /* + We check whether ALTER EVENT was given dates that are in the past. + However to know how to react, we need the ON COMPLETION type. The + check is deferred to this point because by now we have the previous + setting (from the event-table) to fall back on if nothing was specified + in the ALTER EVENT-statement. + */ + + if (parse_data->check_dates(thd, + table->field[ET_FIELD_ON_COMPLETION]->val_int())) + goto end; + /* Don't update create on row update. */ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; |