Skip to content

refactoring default and on update expressions#296

Merged
jycor merged 8 commits intomainfrom
james/now-synonyms
Jan 3, 2024
Merged

refactoring default and on update expressions#296
jycor merged 8 commits intomainfrom
james/now-synonyms

Conversation

@jycor
Copy link
Copy Markdown

@jycor jycor commented Dec 29, 2023

This PR changes the grammar to more closely match MySQL's behavior, specifically around the NOW() function and its synonyms.
Changes:

  • Throw syntax errors for ON UPDATE expressions against functinos that aren't NOW() or a synonym.
  • Only accept integer for argument to NOW() and synonyms; syntax error for anything else
  • Simplified grammar rules
  • Removed CurTimeFuncExpr from AST in favor of plain FuncExpr

Companion PR: dolthub/go-mysql-server#2218

@jycor jycor requested a review from zachmu as a code owner December 29, 2023 00:11
Copy link
Copy Markdown

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, the specifics of the diff are a bit hard to understand but the api refactor makes sense

func_datetime_precision:
openb value_expression closeb
// Optional datetime precision for certain functions.
func_datetime_prec_opt:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

do we have error tests with non-integer precisions?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@jycor jycor merged commit 78fa0d3 into main Jan 3, 2024
@jycor jycor deleted the james/now-synonyms branch January 3, 2024 00:58
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