-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
evalengine: Add handling for current timestamp functions #12742
Conversation
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 <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Dirkjan Bussink <[email protected]>
Signed-off-by: Dirkjan Bussink <[email protected]>
Signed-off-by: Dirkjan Bussink <[email protected]>
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 <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
ddf2f5b
to
83c26e4
Compare
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Dirkjan Bussink <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
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") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
/* | ||
Copyright 2023 The Vitess Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
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