You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Up front, I think the problem is that odbc::sqlCreateTable has a different order of default arguments, leading to a corruption of both row.names= and temporary=.
sqlCreateTable(..., temporary=TRUE) is not adding temporary.
Note that temporary and row.names arguments are reversed. I'm not proficient enough debugging these methods enough to know if I'm introducing any problems, but ... since it doesn't work on the console and this way shows that temporary and row.names have somehow swapped values, then that leads me to think I'm on the right track.
I am currently unable to compile on my windows box (collapse-log below, if you're curious ... but not this issue), so I cannot test, but I wonder if the fix is to move field.types=NULL to the end of parameters.
Database
I've tested this against a couple of DBMSes, most recently postgres-11 on docker, though the same problem evidences in non-local database connections.
DBI::dbGetQuery(con, "select version()")$version# [1] "PostgreSQL 11.8 (Debian 11.8-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit"
I'm having a difficult time testing my theory, since for some reason I can not compile the current version of odbc. I've been able to compile it in the past (with Rtools40, same installation), and I can still compile other packages (e.g., jsonlite, as the rtools40 docs suggest as a quick test). While tangential to this issue, if you happen to know quickly how to fix this error, I'll be able to test my theory better and submit a PR.
Up front, I think the problem is that
odbc::sqlCreateTable
has a different order of default arguments, leading to a corruption of bothrow.names=
andtemporary=
.sqlCreateTable(..., temporary=TRUE)
is not addingtemporary
.On debugging it,
Because this is within the method, I'll debug the
.local
function as well.Note that
temporary
androw.names
arguments are reversed. I'm not proficient enough debugging these methods enough to know if I'm introducing any problems, but ... since it doesn't work on the console and this way shows thattemporary
androw.names
have somehow swapped values, then that leads me to think I'm on the right track.If I force the formals names, then it works:
I suspect that this may be because the signature in
odbc
is different than the signature inDBI
:From: https://github.com/r-dbi/DBI/blob/main/R/table-create.R#L41-L42 and https://github.com/r-dbi/odbc/blob/main/R/Table.R#L169-L170, respectively:
I am currently unable to compile on my windows box (collapse-log below, if you're curious ... but not this issue), so I cannot test, but I wonder if the fix is to move
field.types=NULL
to the end of parameters.Database
I've tested this against a couple of DBMSes, most recently postgres-11 on docker, though the same problem evidences in non-local database connections.
Session Info
fyi: odbc compile fail
I'm having a difficult time testing my theory, since for some reason I can not compile the current version of
odbc
. I've been able to compile it in the past (with Rtools40, same installation), and I can still compile other packages (e.g.,jsonlite
, as the rtools40 docs suggest as a quick test). While tangential to this issue, if you happen to know quickly how to fix this error, I'll be able to test my theory better and submit a PR.The text was updated successfully, but these errors were encountered: