Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support event execution #1786

Merged
merged 80 commits into from
Sep 27, 2023
Merged

support event execution #1786

merged 80 commits into from
Sep 27, 2023

Conversation

jennifersp
Copy link
Contributor

@jennifersp jennifersp commented May 18, 2023

This PR adds event execution logic implementing EventScheduler interface in the engine.
Notes:

  • Event Scheduler status cannot be updated at run-time.
  • Event DISABLE ON SLAVE status is not supported. It will be set to DISABLE by default.

Corresponding Dolt changes: dolthub/dolt#6108

jennifersp and others added 30 commits May 17, 2023 12:21

// GetTimeValueFromStringInput returns time.Time in system timezone (SYSTEM = time.Now().Location()).
// evaluating valid MySQL datetime and timestamp formats.
func GetTimeValueFromStringInput(field, t string) (time.Time, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there existing code we could use to parse a string timestamp or does this have unique behavior? Could we use Datetime.Convert(string) instead? If not, would be good to document why this code needs to be different; it seems like the datetime parsing should be the same across MySQL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, I added this method because our current method of parsing datetime or timestamp type values does not match MySQL. It is mentioned as TODO /~https://github.com/dolthub/go-mysql-server/blob/main/sql/types/datetime.go#L232

The reason I wrote incomplete (the timestamp string parsing is missing) parsing method that is different from our current one here is that event queries use datetime value very commonly and that it needs to parse some formats that our current Datetime.Convert(string) method is not able to parse. This caused many event query cases to fail.

… modified out of band (i.e. without going through CREATE EVENT, ALTER EVENT, DROP EVENT).
…g into GMS layer and getting rid of ReloadEvents function in the EventDatabase interface.
@fulghum fulghum merged commit 44ab355 into main Sep 27, 2023
@jennifersp jennifersp deleted the jennifer/event-execution branch October 25, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants