Skip to content

Commit d99f203

Browse files
author
James Cor
committed
events
1 parent ea86bfb commit d99f203

File tree

4 files changed

+0
-42
lines changed

4 files changed

+0
-42
lines changed

sql/events.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ import (
2828

2929
const EventDateSpaceTimeFormat = "2006-01-02 15:04:05"
3030

31-
// EventSchedulerStatement represents a SQL statement that requires a EventScheduler
32-
// (e.g. CREATE / ALTER / DROP EVENT and DROP DATABASE).
33-
// TODO: consider deleting this interface
34-
type EventSchedulerStatement interface {
35-
Node
36-
// WithEventScheduler returns a new instance of this EventSchedulerStatement,
37-
// with the event scheduler notifier configured.
38-
WithEventScheduler(controller EventScheduler) Node
39-
}
40-
4131
// EventScheduler is an interface used for notifying the EventSchedulerStatus
4232
// for querying any events related statements. This allows plan Nodes to communicate
4333
// to the EventSchedulerStatus.

sql/plan/alter_event.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
var _ sql.Node = (*AlterEvent)(nil)
3232
var _ sql.Expressioner = (*AlterEvent)(nil)
3333
var _ sql.Databaser = (*AlterEvent)(nil)
34-
var _ sql.EventSchedulerStatement = (*AlterEvent)(nil)
3534

3635
type AlterEvent struct {
3736
ddlNode
@@ -405,13 +404,6 @@ func (a *AlterEvent) WithExpressions(e ...sql.Expression) (sql.Node, error) {
405404
return &na, nil
406405
}
407406

408-
// WithEventScheduler is used to notify EventSchedulerStatus to update the events list for ALTER EVENT.
409-
func (a *AlterEvent) WithEventScheduler(scheduler sql.EventScheduler) sql.Node {
410-
na := *a
411-
na.scheduler = scheduler
412-
return &na
413-
}
414-
415407
// alterEventIter is the row iterator for *CreateEvent.
416408
type alterEventIter struct {
417409
once sync.Once

sql/plan/dbddl.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ type DropDB struct {
127127

128128
var _ sql.Node = (*DropDB)(nil)
129129
var _ sql.CollationCoercible = (*DropDB)(nil)
130-
var _ sql.EventSchedulerStatement = (*DropDB)(nil)
131130

132131
func (d *DropDB) Resolved() bool {
133132
return true
@@ -157,13 +156,6 @@ func (d *DropDB) WithChildren(children ...sql.Node) (sql.Node, error) {
157156
return NillaryWithChildren(d, children...)
158157
}
159158

160-
// WithEventScheduler is used to drop all events from EventSchedulerStatus for DROP DATABASE.
161-
func (d *DropDB) WithEventScheduler(scheduler sql.EventScheduler) sql.Node {
162-
na := *d
163-
na.Scheduler = scheduler
164-
return &na
165-
}
166-
167159
// CheckPrivileges implements the interface sql.Node.
168160
func (d *DropDB) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool {
169161
return opChecker.UserHasPrivileges(ctx, sql.NewPrivilegedOperation(sql.PrivilegeCheckSubject{}, sql.PrivilegeType_Drop))

sql/plan/ddl_event.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
var _ sql.Node = (*CreateEvent)(nil)
3333
var _ sql.Expressioner = (*CreateEvent)(nil)
3434
var _ sql.Databaser = (*CreateEvent)(nil)
35-
var _ sql.EventSchedulerStatement = (*CreateEvent)(nil)
3635

3736
type CreateEvent struct {
3837
ddlNode
@@ -258,13 +257,6 @@ func (c *CreateEvent) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowIter, error)
258257
}, nil
259258
}
260259

261-
// WithEventScheduler is used to notify EventSchedulerStatus to update the events list for CREATE EVENT.
262-
func (c *CreateEvent) WithEventScheduler(scheduler sql.EventScheduler) sql.Node {
263-
nc := *c
264-
nc.scheduler = scheduler
265-
return &nc
266-
}
267-
268260
// GetEventDefinition returns an EventDefinition object with all of its fields populated from the details
269261
// of this CREATE EVENT statement.
270262
func (c *CreateEvent) GetEventDefinition(ctx *sql.Context, eventCreationTime, lastAltered, lastExecuted time.Time, tz string) (sql.EventDefinition, error) {
@@ -583,7 +575,6 @@ func (ost *OnScheduleTimestamp) EvalTime(ctx *sql.Context, tz string) (time.Time
583575

584576
var _ sql.Node = (*DropEvent)(nil)
585577
var _ sql.Databaser = (*DropEvent)(nil)
586-
var _ sql.EventSchedulerStatement = (*DropEvent)(nil)
587578

588579
type DropEvent struct {
589580
ddlNode
@@ -670,10 +661,3 @@ func (d *DropEvent) WithDatabase(database sql.Database) (sql.Node, error) {
670661
nde.Db = database
671662
return &nde, nil
672663
}
673-
674-
// WithEventScheduler is used to notify EventSchedulerStatus to update the events list for DROP EVENT.
675-
func (d *DropEvent) WithEventScheduler(scheduler sql.EventScheduler) sql.Node {
676-
nd := *d
677-
nd.scheduler = scheduler
678-
return &nd
679-
}

0 commit comments

Comments
 (0)