-
Notifications
You must be signed in to change notification settings - Fork 219
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: LIKE expression with invalid string literals returns a parse error instead of panicking #1046
fix: LIKE expression with invalid string literals returns a parse error instead of panicking #1046
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.
LGTM
For reference, here's the spec for like-operation [ref]
like-operation ::= expression not-operator? like-operator string-literal
string-literal ::= ( "'" ( [^'] | "\'" )* "'" ) | ( '"' ( [^"] | '\"' )* '"')
Aside from my minor question, LGTM |
cc @embano1 |
do we have a testcase for this? |
@duglin yes, the new tck test in this PR runs and passes with this change, but prior to the change it would panic |
@duglin for final approval/merge |
…or instead of panic Signed-off-by: Calum Murray <cmurray@redhat.com>
6f1b2c3
to
3e20125
Compare
LGTM - it needed a rebase so kicked that off... |
merging... |
Fixes #931
When visiting the nodes of the AST while parsing the LIKE expression, it looks like we assumed that we would have a valid string literal. However, it is possible that there is no valid string literal, in which case we have to handle that and return an error rather than continuing to parse (and subsequently panicking)