Skip to content
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

Open
firebird-automations opened this issue Apr 25, 2013 · 6 comments
Open

Incorrect SQL executes without error [CORE4092] #4420

firebird-automations opened this issue Apr 25, 2013 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I see neither missing nor extra parenthesis. (R1.Kuupaev <= 41364 AND (R1.Parent IS NULL)) is a perfectly valid syntax.

@firebird-automations
Copy link
Collaborator Author

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?

@firebird-automations
Copy link
Collaborator Author

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Every lexer I know breaks tokens as soon as it cannot continue, instead of requiring spaces.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

You might be right. I checked just now and MS SQL Server behaves the same.

@firebird-automations
Copy link
Collaborator Author

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant