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

Using io keyword as table alias fails to parse #496

Closed
BackEndTea opened this issue Aug 14, 2023 · 3 comments
Closed

Using io keyword as table alias fails to parse #496

BackEndTea opened this issue Aug 14, 2023 · 3 comments
Assignees
Labels
Milestone

Comments

@BackEndTea
Copy link
Contributor

This first query fails to parse with Unrecognized keyword, Unrecognized token and This type of clause was previously parsed errors, while the second one has no issues

I get that using keywords as table aliases may not be the smartest, but this is valid SQL 😅 . Could sql-parser support this?

SELECT  COUNT(*) AS amount
FROM    one i
JOIN    two io ON io.id = i.id
SELECT  COUNT(*) AS amount
FROM    one i
JOIN    two ioo ON ioo.id = i.id
@williamdes
Copy link
Member

That's weird, we should definitely support it. I am puzzled it's not already the case

@williamdes williamdes added the bug label Aug 14, 2023
@BackEndTea
Copy link
Contributor Author

I'm currently running sql-parser against all queries inside of our code base. (which resulted in the issues i just opened).

If you could give me some pointers to where i could roughly look to add support for this i'd be happy to do so

@williamdes
Copy link
Member

@MauricioFauth MauricioFauth self-assigned this Jan 20, 2024
@MauricioFauth MauricioFauth added this to the 5.9.0 milestone Jan 20, 2024
MauricioFauth added a commit that referenced this issue Jan 20, 2024
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants