-
Notifications
You must be signed in to change notification settings - Fork 605
FROM
not rejected in column position
#166
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
Comments
FROM
keyword not rejected in column positionFROM
not rejected in column position
I agree that accepting But it's not obvious to me how this should be changed or why. Some context: There have been precedents for adding validations to reject such obviously incorrect code, e.g. in https://github.com/andygrove/sqlparser-rs/pull/118, but also for disabling such validations because some dialect was found to accept what we thought was universally rejected (https://github.com/andygrove/sqlparser-rs/issues/154). In general, sqlparser does not promise to be a validating parser, that definitely rejects "invalid" SQL, because there's no commonly accepted definition of such a thing. I did some research on "reserved keywords" in various dialects before I implemented the current behavior:
|
Your reasoning is pretty convincing - thanks for laying it out so clearly! |
Parsing
SELECT FROM abc
succeeds with:It seems suprising that parsing accepted
FROM
as a column identifier! The SQL engines I've quickly tried out (sqlite locally, a handful of online validators) all seem to indicate that it's invalid - maybe it should be rejected?The text was updated successfully, but these errors were encountered: