-
-
Notifications
You must be signed in to change notification settings - Fork 238
implement NOW() siblings
#2218
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
implement NOW() siblings
#2218
Conversation
…sql-server into james/now-siblings
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.
LGTM, the biggest thing I'm noticing is that we could frontload some of the precision resolving. Not blocking though
sql/expression/function/time.go
Outdated
| // Must receive integer | ||
| // Should syntax error before this; check anyway | ||
| var fsp int | ||
| switch p := prec.(type) { |
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.
Lot of overlap with the default resolving, can we push all of this into planbuilder when resolving now functions? It might be easy to resolve as an integer type upfront also, one less expression to track through analysis
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.
It looks like there are other functions, like CURRENT_TIME and UTC_TIMESTAMP, that should be using similar logic. Will do this refactor in a follow up PR.
This PR has our behavior surrounding
NOW()functions more closely match MySQL.Changes:
NOW()synonyms to registryCURRENT_TIMESTAMP(),LOCALTIME(),LOCALTIMESTAMP()all just callNOW()DEFAULTandON UPDATEexpressionsSHOW CREATE TABLEto printCURRENT_TIMESTAMPforNOW()and synonymsCompanion PR: dolthub/vitess#296
Fixes:
current_timestampsynonyms dolt#7129current_timestamp()andnow()do not return the same values dolt#6058