-
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
Fix: Date math with Interval keyword #12082
Conversation
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
I am unsure about the backport to any supported release. This syntax isn't really a regression, but it is still a bug fix. |
I think for this reason, let's not backport it @GuptaManan100. |
Would it be possible to backport this to v14? It has already appeared in a few places and broken people's queries, making it very difficult for us to upgrade to v14 |
This works for our test cases (ported it over and ran vtcombo with the unit tests that were previously failing) |
@dbussink I am looking into the failure. This is very weird though. The test seems to work for me locally! |
Oh I just figured it out! Lol, the failure is because of different time zones. The UTC value is interpreted correctly, but the system time-zone is used to print the output. For me the timezone is IST which is +5:30, so it prints a time like |
Ah yeah, we probably have to assume UTC for things like this? And enforce that in the test? |
Signed-off-by: Manan Gupta <manan@planetscale.com>
I set the time-zone explicitly in the test now. Its a session setting which can be changed and this is something that Vitess allows to change too, so all good! |
I was unable to backport this Pull Request to the following branches: |
* feat: add failing parsing test and fix parser Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add e2e tests for interval with math functions Signed-off-by: Manan Gupta <manan@planetscale.com> * test: explictly set the time-zone to prevent failures in CI Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: add failing parsing test and fix parser Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add e2e tests for interval with math functions Signed-off-by: Manan Gupta <manan@planetscale.com> * test: explictly set the time-zone to prevent failures in CI Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: add failing parsing test and fix parser Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add e2e tests for interval with math functions Signed-off-by: Manan Gupta <manan@planetscale.com> * test: explictly set the time-zone to prevent failures in CI Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
* Fix: Date math with Interval keyword (#12082) * feat: add failing parsing test and fix parser Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add e2e tests for interval with math functions Signed-off-by: Manan Gupta <manan@planetscale.com> * test: explictly set the time-zone to prevent failures in CI Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> * test: fix expected output Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: add failing parsing test and fix parser Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add e2e tests for interval with math functions Signed-off-by: Manan Gupta <manan@planetscale.com> * test: explictly set the time-zone to prevent failures in CI Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
Description
This PR fixes the issue described in #12076.
The queries which are valid but didn't work with Vitess have been added as tests and the parser has been patched.
Related Issue(s)
Checklist
Deployment Notes