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

Queries failing for schemas / tables that contain special characters - MySQL #776

Open
Choc13 opened this issue Nov 17, 2022 · 0 comments
Open

Comments

@Choc13
Copy link
Contributor

Choc13 commented Nov 17, 2022

Describe the bug
We have a schema name like my-schema in MySQL. When querying this schema we are required to enclose it in backticks to escape the hyphen. It seems however that the SQL generated by SQL Provider does not contain backticks around schema or table names (although it does around column names).

In principle would it be possible to always wrap schema and table names in backticks to ensure they are properly escaped? If so I'm happy to submit a PR.

On a side note I think this might be the underlying cause of the other issue (#773) I opened about the missing Create(...) functions.

To Reproduce
Create a schema in MySQL that contains a - in the name and try to query it.

Expected behavior
The generated SQL should be more like:

SELECT `a` as `a`
FROM `my-schema`.`my-table`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant