lava-oushudb-dt-sql-parser/test/parser/mysql/syntax/fixtures/alterEvent.sql
琉易 428d851913
feat: #190 improve mysql grammer (#196)
* refactor: generic rename to mysql

* refactor: g4 with mysql syntax

* test: mysql syntax

* refactor: remove useless keywords

* refactor: remove nonReserved keywords

* refactor: lint specificFunction

---------

Co-authored-by: liuyi <liuyi@dtstack.com>
2023-11-27 15:25:40 +08:00

27 lines
719 B
SQL

-- https://dev.mysql.com/doc/refman/8.0/en/alter-event.html
/* ALTER
[DEFINER = user]
EVENT event_name
[ON SCHEDULE schedule]
[ON COMPLETION [NOT] PRESERVE]
[RENAME TO new_event_name]
[ENABLE | DISABLE | DISABLE ON SLAVE]
[COMMENT 'string']
[DO event_body] */
ALTER EVENT no_such_event ON SCHEDULE EVERY '2:3' DAY_HOUR;
ALTER EVENT myevent ON SCHEDULE EVERY 12 HOUR STARTS CURRENT_TIMESTAMP + INTERVAL 4 HOUR;
ALTER EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY DO TRUNCATE TABLE myschema.mytable;
ALTER EVENT myevent DISABLE;
ALTER EVENT myevent RENAME TO yourevent;
ALTER EVENT myevent RENAME TO yourevent;
ALTER EVENT olddb.myevent RENAME TO newdb.myevent;