-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
dbWriteTable not escaping column names in 0.3.1 release #2622
Comments
Thanks for the report! Indeed it seems like the column name needs to be escaped.
That would be fantastic! |
This comment was marked as abuse.
This comment was marked as abuse.
This may be where the reserved column name keywords are listed: https://github.com/duckdb/duckdb/tree/master/third_party/libpg_query/grammar/keywords (more details in #989) |
Sorry for that, we're missing a call to |
What happens?
Version 0.3.1, using
dbWriteTable()
with aname
column infield.types
specified results in invalid SQL being generated.This has been picked up by CRAN package checks on the downstream MFDB package: https://cran.r-project.org/web/checks/check_results_mfdb.html
To Reproduce
The command-line thinks this is invalid SQL too (and is fair enough IMO, name is probably a reserved word):
If you ask me the bug is here, the SQL generation isn't escaping the column name:
duckdb/tools/rpkg/R/Connection.R
Line 184 in 9fd0403
this was added in this commit, part of 0.3.1 8aed295. I can make a pull request to add some escaping here if that's useful?
Cheers!
Environment (please complete the following information):
Debian GNU/Linux 10 (buster)
0.3.2
R version 4.1.1 (2021-08-10)
Before Submitting
master
branch?install.packages("https://github.com/duckdb/duckdb/releases/download/master-builds/duckdb_r_src.tar.gz", repos = NULL)
The text was updated successfully, but these errors were encountered: