Skip to content

Commit 26d3317

Browse files
committed
fix: dbQuoteLiteral() uses exponential notation for numeric values
1 parent a23c544 commit 26d3317

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/dbQuoteLiteral_DBIConnection.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ dbQuoteLiteral_DBIConnection <- function(conn, x, ...) {
4848
return(SQL(blob_data, names = names(x)))
4949
}
5050

51+
if (is.double(x)) {
52+
out <- sprintf("%.17e", x)
53+
out[is.na(x)] <- "NULL"
54+
return(SQL(out, names = names(x)))
55+
}
56+
5157
if (is.logical(x)) {
52-
x <- as.numeric(x)
58+
x <- as.integer(x)
5359
}
5460

5561
x <- as.character(x)

0 commit comments

Comments
 (0)