evalengine: Add handling for current timestamp functions#12742
Merged
vmg merged 14 commits intovitessio:mainfrom Mar 29, 2023
Merged
evalengine: Add handling for current timestamp functions#12742vmg merged 14 commits intovitessio:mainfrom
vmg merged 14 commits intovitessio:mainfrom
Conversation
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
1b5fb0f to
0e29b63
Compare
0e29b63 to
d49f60d
Compare
45b0d20 to
86a1731
Compare
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
This adds support for handling `USER()`, `DATABASE()` and `VERSION()`. The last two have fairly well defined semantics, but the first is really a best effort. `USER()` returns the effective caller id if it's set, and otherwise falls back to the default `vt_app@localhost` that Vitess uses. Today the value that is returned isn't very useful on Vitess anyway since it returns the MySQL level user. So the called id is in practice more useful already if available. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Vicent Marti <vmg@strn.cat>
ddf2f5b to
83c26e4
Compare
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
vmg
approved these changes
Mar 29, 2023
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
vmg
reviewed
Mar 29, 2023
Comment on lines
+180
to
+199
| func (spec_U) format(ctx *formatctx, b []byte) []byte { | ||
| panic("TODO") | ||
| } | ||
|
|
||
| func (spec_u) format(ctx *formatctx, b []byte) []byte { | ||
| panic("TODO") | ||
| } | ||
|
|
||
| func (spec_V) format(ctx *formatctx, b []byte) []byte { | ||
| panic("TODO") | ||
| } | ||
|
|
||
| func (spec_v) format(ctx *formatctx, b []byte) []byte { | ||
| _, week := ctx.t.ISOWeek() | ||
| return appendInt(b, week, 2) | ||
| } | ||
|
|
||
| func (spec_X) format(ctx *formatctx, b []byte) []byte { | ||
| panic("TODO") | ||
| } |
Collaborator
There was a problem hiding this comment.
Note that these parsing specs are left as TODO because they're not being used by any of the parser code. They'll be eventually implemented when we get to DATE_FORMAT
frouioui
reviewed
Mar 29, 2023
Comment on lines
+1
to
+2
| /* | ||
| Copyright 2023 The Vitess Authors. |
frouioui
approved these changes
Mar 29, 2023
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds support for time related functions for the current date and / or time like
NOW().It also adds support for dealing with
USER(),DATABASE()andVERSION().Related Issue(s)
Part of #9647. Also helps improve the situation for issues like #12674
Checklist