classEventRule
final class EventRule
Lowers CREATE EVENT and ALTER EVENT.
Rule: MYSQL-EVENT-LOWERING-001. Scope: event_tail, ev_schedule_time, ev_starts, ev_ends, opt_ev_on_completion, ev_on_completion, opt_ev_status, opt_ev_comment, ev_alter_on_schedule_completion, opt_ev_rename_to, opt_ev_sql_stmt, alter_event_stmt and the alter alternative of events (5.6, 5.7). The statement of the event is lowered by MYSQL-PROGRAM-STATEMENT-LOWERING-001. Constructs: CreateEvent, AlterEvent, OnceSchedule, RecurringSchedule. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-event.html, https://dev.mysql.com/doc/refman/8.4/en/alter-event.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function create(Node $tail, ?Account $definer): CreateEventLowers CREATE EVENT: a node of event_tail, and the definer.
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 10
- method-call Lowering::form() line 90
- class-const EventRule::TAILS() line 91
- static-call ImplementationGap::production() line 91
- new CreateEvent line 97
- method-call EventRule::schedule() line 99
- method-call StatementRule::event() line 100
- new StatementRule line 100
- method-call EventRule::completion() line 103
- method-call EventRule::status() line 106
- method-call EventRule::comment() line 107
public function alter(Form $form): AlterEventLowers ALTER EVENT: the form of the 5.x alter alternative or of alter_event_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 11
- class-const EventRule::ALTERS() line 120
- static-call ImplementationGap::production() line 121
- method-call Lowering::form() line 123
- method-call Form::node() line 123
- method-call EventRule::schedule() line 126
- method-call EventRule::completion() line 127
- new AlterEvent line 135
- method-call EventRule::status() line 144
- method-call EventRule::comment() line 145
- method-call StatementRule::event() line 148
- new StatementRule line 148
Lowers a schedule: a node of ev_schedule_time.
Parameters
$schedule | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::create() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:99
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::alter() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:126
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::alter() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:129
Calls 5
- method-call Lowering::form() line 162
- new OnceSchedule line 165
- new RecurringSchedule line 166
- method-call EventRule::bound() line 169
- static-call ImplementationGap::production() line 172
Lowers the STARTS or ENDS clause: a node of ev_starts or ev_ends; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 2
Calls 2
- method-call Lowering::form() line 183
- static-call ImplementationGap::production() line 188
public function completion(Node $clause): CompletionLowers ON COMPLETION [NOT] PRESERVE: a node of ev_on_completion.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::create() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:103
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::alter() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:127
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\EventRule::alter() packages/sql-semantics-mysql/src/Lowering/Routine/EventRule.php:129
Calls 3
- method-call Lowering::form() line 199
- class-const EventRule::COMPLETIONS() line 201
- static-call ImplementationGap::production() line 201
public function status(Node $clause): ?EventStatusLowers the status clause: a node of opt_ev_status; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 4
- method-call Lowering::form() line 211
- function-call
array_key_existsline 212 - class-const EventRule::STATUSES() line 212
- static-call ImplementationGap::production() line 213
Lowers the COMMENT clause: a node of opt_ev_comment; an absent clause is null.
Parameters
$clause | Node |
Returns
?TextThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 2
- method-call Lowering::form() line 226
- static-call ImplementationGap::production() line 231
Private surface 5§
Implementation details, listed for orientation only.
private const TAILS = ['event_tail: remember_name EVENT_SYM opt_if_not_exists sp_name ON SCHEDULE_SYM…private const ALTERS = ['alter: ALTER definer_opt EVENT_SYM sp_name ev_alter_on_schedule_completion op…private const STATUSES = ['opt_ev_status:' => null, 'opt_ev_status: ENABLE_SYM' => \SqlSemantics\Platfor…private const COMPLETIONS = ['ev_on_completion: ON COMPLETION_SYM PRESERVE_SYM' => \SqlSemantics\Platform\M…private Lowering $loweringTest cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
EventRuleTest::testAlterRefusesAnotherProductioncallsEventRuleTest::testBoundRefusesAnotherProductioncallsEventRuleTest::testCommentRefusesAnotherProductioncallsEventRuleTest::testCompletionRefusesAnotherProductioncallsEventRuleTest::testCreateRefusesAnotherProductioncallsEventRuleTest::testScheduleRefusesAnotherProductioncallsEventRuleTest::testStatusRefusesAnotherProductioncalls
Relations§
Instantiated in 2
Method calls 2
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::definition() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:68
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::create() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:87