-
Notifications
You must be signed in to change notification settings - Fork 602
fix: maybe_parse
preventing parser from erroring on recursion limit
#1464
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
Conversation
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.
Thanks for this fix @tomershaniii! Would it be possible to include a test case that passes with this fix? If so we could add one here for example
e5aa255
to
e474fd2
Compare
@iffyio took some yak shaving but it's finally here :-) check out
|
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.
Looks great to me -- than you @tomershaniii and @iffyio
@@ -3191,7 +3191,7 @@ pub enum Statement { | |||
/// Table confs | |||
options: Vec<SqlOption>, | |||
/// Cache table as a Query | |||
query: Option<Query>, | |||
query: Option<Box<Query>>, |
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.
this is a nice change
@@ -1103,7 +1103,7 @@ pub enum PivotValueSource { | |||
/// Pivot on all values returned by a subquery. | |||
/// | |||
/// See <https://docs.snowflake.com/en/sql-reference/constructs/pivot#pivot-on-column-values-using-a-subquery-with-dynamic-pivot>. | |||
Subquery(Query), | |||
Subquery(Box<Query>), |
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.
👍
match f(self) { | ||
Ok(t) => Ok(Some(t)), | ||
// Unwind stack if limit exceeded | ||
Err(ParserError::RecursionLimitExceeded) => Err(ParserError::RecursionLimitExceeded), |
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.
👍
Looks like a CI check is failing on this PR |
Pull Request Test Coverage Report for Build 11440876981Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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! thanks @tomershaniii
e474fd2
to
5b86547
Compare
5b86547
to
8ee028a
Compare
CI issues fixed, please re-run |
f2e6c1b
to
194147d
Compare
Build broken by another commit, please re-run CI |
🤔 CI is still failing unfortunately |
194147d
to
edce476
Compare
fbfaa1e
to
3880697
Compare
yet another rebase fix @alamb plz... |
🚀 |
Thanks for sticking with this @tomershaniii and for the review @iffyio |
maybe_parse
preventing parser from erroring on recursion limit
This PR fixes a bug in the recursion checks, the bug is caused by maybe_parse ignoring the returned error, which (in the case of recursion depth check) prevents the Error from propagating back to the caller and may lead to unexpected parsing results.
The fix involves specific handling of the
RecursionLimitExceeded
error withinmaybe_parse
and returning the error up the call stack.