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
Incorrect SQL executes without error [CORE4092] #4420
Comments
Commented by: @dyemanov I see neither missing nor extra parenthesis. (R1.Kuupaev <= 41364 AND (R1.Parent IS NULL)) is a perfectly valid syntax. |
Commented by: Ain Valtin (ain) Hmm, now when you did put the space between the "41364" and "AND" I can parse it too and it looks valid indeed... so the question is should it be accepted without the space? |
Commented by: @mrotteveel In my opinion the parser should require whitespace (so also linebreaks, tabs etc) here. It should need whitespace or a parenthesis before or after a boolean operator Eg ... = 123)AND(345 = ...) or ...= 123 AND 345 = ... should be acceptable, but ...=123AND345=... shouldn't be valid. |
Commented by: @asfernandes Every lexer I know breaks tokens as soon as it cannot continue, instead of requiring spaces. |
Commented by: @mrotteveel You might be right. I checked just now and MS SQL Server behaves the same. |
Commented by: Sean Leyne (seanleyne) It seems that the current logic is correct, no? If so, I will close the issue as "won't fix". |
Submitted by: Ain Valtin (ain)
I just noticed that query like following executes OK
SELECT DISTINCT ...
FROM TAB_T m
LEFT JOIN TAB_G R1 ON(R1.Tooleping = m.Tooleping)AND(R1.Kuupaev >= 41334)AND(R1.Kuupaev <= 41364AND(R1.Parent IS NULL))
WHERE ...
Note the missing closing parenthesis before final AND and the extra one in the end.
The text was updated successfully, but these errors were encountered: