-
Notifications
You must be signed in to change notification settings - Fork 105
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
c/driver/sqlite: Use of implicit "main" schema and/or table names that require quoting broken for SQLite in 0.6.x #1000
Comments
Hmm. Thanks for the report. Maybe we should do a 0.6.1... |
That would be much appreciated ;) |
Ah, we started quoting the table name and columns for you because of #905. But we didn't quote it in the However, that leaves question of how to handle the catalog name ambiguous. Right now we would create a table |
Curious why the same issue doesn't hit the PostgreSQL driver (I just tested); maybe some parsing/quoting logic can be lifted from there? I'm not sure that quoting table names by default is a good idea though (or at least not those containing "."), as access to You can determine recognised database names in SQLite using |
We might not have implemented the escaping for Postgres. In general the problem is that we only have a table name, and we didn't provide for a catalog/schema name. We could add parameters to set those separately? |
Though again, setting the active catalog/schema also covers that (it's not that we can't support it in SQLite, just a question of maintainer time) |
I merged the first fix, but going to leave this open for further discussion. I think adding explicit parameters for the target catalog/schema would make the most sense, and would save you from having to know about quoting rules for specific backends entirely. |
Indeed, otherwise it's going to be a can of worms explicitly handling every flavour of quoting (backtick, double-quote, square bracket). It's important to be able to do so though, as demonstrated above 👍 |
- Support target catalog/schema options for ingestion - Fix escaping in SQLite, PostgreSQL Fixes apache#1000.
- Support target catalog/schema options for ingestion - Fix escaping in SQLite, PostgreSQL Fixes #1000.
It seems something significant has changed between the 0.5.x and 0.6.x releases, as the standard
main
1 db schema can no longer be referenced in SQLite queries, and neither can table names that need to be quoted.The following minimal test-cases demonstrate the issues:
Setup
Use of
main
with a simple table name......now raises:
Use of a table name that requires quoting...
...now raises:
In the previous release (0.5.x) these examples both work correctly, as expected 👍
Footnotes
Note that
main
should always be valid, as it refers to the primary db being connected to (other names can be brought in viaATTACH DATABASE
). ↩The text was updated successfully, but these errors were encountered: