Skip to content

Commit

Permalink
Fixed typecasting with ODBC
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Dec 5, 2023
1 parent cb33240 commit 42965fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.1 (unreleased)

- Fixed typecasting with ODBC

## 0.3.0 (2023-11-30)

- Fixed issue with RMariaDB 1.3.0+
Expand Down
8 changes: 7 additions & 1 deletion R/select.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ fetchRecords <- function(conn, statement, params) {
res <- DBI::dbSendQuery(conn, statement)
})

if (!isSQLite(conn)) {
column_info <- DBI::dbColumnInfo(res)
}

# always fetch at least once
ret[[length(ret) + 1]] <- DBI::dbFetch(res)

# must come after first fetch call for SQLite
column_info <- DBI::dbColumnInfo(res)
if (isSQLite(conn)) {
column_info <- DBI::dbColumnInfo(res)
}

while (!DBI::dbHasCompleted(res)) {
ret[[length(ret) + 1]] <- DBI::dbFetch(res)
Expand Down

0 comments on commit 42965fe

Please sign in to comment.