-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql: don't use the grammar to enforce expression const-ness in AOST #27206
Conversation
@@ -23,6 +23,15 @@ SELECT * FROM t AS OF SYSTEM TIME INTERVAL '-1ns' | |||
---- | |||
2 | |||
|
|||
# Verify that we can use computed expressions. |
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.
Add another test with AOST now()
to verify non-constant expressions don't work.
Also could you remove the restriction in
|
27212: server: clarify TestReportUsage r=knz a=knz Needed to clarify this and remove the magic constant "16" while working on #27206. Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]>
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.
Also could you remove the restriction in cockroach/pkg/testutils/sqlutils/pretty.go Line 30 in ca89c4f
Done
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/logictest/testdata/logic_test/as_of, line 26 at r1 (raw file):
Previously, mjibson (Matt Jibson) wrote…
Add another test with
AOST now()
to verify non-constant expressions don't work.
Done.
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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale)
Thank you!
bors r+
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Merge conflict |
Prior to this patch, AS OF SYSTEM TIME relied on the grammar to restrict its operand to just constants. This was an unfortunate approach because it prevented other constant expressions like `('a' || 'b')::INTERVAL` (or, encountered during tests, `'1ms':::INTERVAL`). This patch corrects this situation by relaxing the grammar constraint and instead verifying the const-ness of the expression after type checking. Release note (sql change): AS OF SYSTEM TIME can now use some more complex expressions to compute the desired time stamp.
bors r+ |
27206: sql: don't use the grammar to enforce expression const-ness in AOST r=knz a=knz Fixes #26976. Prior to this patch, AS OF SYSTEM TIME relied on the grammar to restrict its operand to just constants. This was an unfortunate approach because it prevented other constant expressions like `('a' || 'b')::INTERVAL` (or, encountered during tests, `'1ms':::INTERVAL`). This patch corrects this situation by relaxing the grammar constraint and instead verifying the const-ness of the expression after type checking. Release note (sql change): AS OF SYSTEM TIME can now use some more complex expressions to compute the desired time stamp. Co-authored-by: Raphael 'kena' Poss <[email protected]>
Build succeeded |
27214: sql/parser: remove the now-unused a_expr_const non-terminal r=knz a=knz First 3 commits from #27212, #27206 and #27213 27434: roachtest: skip tests run on expired clusters r=benesch a=petermattis Check to see if the cluster is expired before starting a test. Tests are skipped if the cluster is expired which prevents 1 timed out test from causing a cascade of issues to be posted for subsequent subtests. Fixes #27166 Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Peter Mattis <[email protected]>
Fixes #26976.
Prior to this patch, AS OF SYSTEM TIME relied on the grammar to
restrict its operand to just constants. This was an unfortunate
approach because it prevented other constant expressions like
('a' || 'b')::INTERVAL
(or, encountered during tests,'1ms':::INTERVAL
).This patch corrects this situation by relaxing the grammar constraint
and instead verifying the const-ness of the expression after type
checking.
Release note (sql change): AS OF SYSTEM TIME can now use some more
complex expressions to compute the desired time stamp.