Repository navigation
Breaking changes
-
INT UNSIGNEDcolumns are returned as numeric, exact over their full range,
instead of as integer, which turned values above 2147483647 into negative values orNA(#639).
Useas.integer()on the column where code relies on an integer and all values fit one.
BIGINT UNSIGNEDand the other integer types are returned as before.dbExecute(con, "CREATE TEMPORARY TABLE t (x INT UNSIGNED)") dbExecute(con, "INSERT INTO t VALUES (4294967295)") dbGetQuery(con, "SELECT x FROM t")$x #> [1] 4294967295
-
DATE,DATETIMEandTIMESTAMPvalues with a zero year, month or day are returned asNAinstead of as nonsensical dates (#598). -
Writing time values that are infinite or out of range fails with an error that names the affected columns,
instead of storing garbage (#623).
Replace such values withNAbefore writing. -
dbAppendTable(),dbBind(),dbWriteTable()andsqlData()fail onInfand-Infin numeric columns instead of writingNULL,
also withload_data_local_infile = TRUE(#636).
NaNandNAare still written asNULL.
To keep the old behavior, replace infinite values withNAbefore writing:df$x[is.infinite(df$x)] <- NA dbWriteTable(con, "tbl", df)
Features
-
dbConnect()gains anssl.modeargument that requires or relaxes TLS verification,
modeled after the--ssl-modeoption of themysqlcommand-line client (#650).
It takes"disabled","preferred","required","verify_ca"or"verify_identity".
The defaultNULLkeeps the behavior of the client library.
?dbConnectlists which client library supports which mode.
The error for a certificate that fails verification points tossl.caandssl.mode = "required",
building on an earlier hint by @jeroen.con <- dbConnect( RMariaDB::MariaDB(), host = Sys.getenv("DB_HOST"), ssl.mode = "verify_identity", ssl.ca = "~/certs/server-ca.pem" )
-
dbGetQueryArrow(),dbReadTableArrow()and the other Arrow generics, as well asdbGetConnectArgs(), are reexported from DBI,
so that DBI's default methods apply to RMariaDB's connections and results (#584).
RMariaDB now requires DBI >= 1.2.3.con <- dbConnect(RMariaDB::MariaDB(), dbname = "test") stream <- dbGetQueryArrow(con, "SELECT 1 AS a, 'x' AS b") as.data.frame(stream)
Bug fixes
-
Bound times are rounded to the nearest microsecond (#610).
-
hmsvalues of 256 hours or more are bound without wrapping around (#616). -
Warnings are raised only after the C++ code is done with the result,
so that a calling handler can no longer free the result or close the connection in use (#632). -
The package compiles with the MySQL client library 26.x,
detecting MariaDB Connector/C by its own macros instead of by version number (#628). -
configureno longer adds a Homebrew OpenSSL path on macOS, which caused a warning on CRAN (@jeroen). -
dbBegin(),dbCommit(),dbExecute(),dbExistsTable(),dbRollback()anddbSendQuery()on a disconnected connection
fail with a clear error (#640). -
dbBind()reads the result types after execution,
so that placeholder columns such asSELECT ? AS xkeep their values (#618). -
dbBind()accepts parameters whose names are all empty (#607). -
dbBind()leaves the result unbound after a failed rebind, instead of out of sync (#620). -
dbCreateTable()gives character and factor columns without a non-NAvalue, such as those of zero-row data frames,
the typeTEXTinstead ofVARCHAR(1)(#588). -
dbDisconnect()closes the connection before freeing its result,
and the methods of a result whose connection is closed fail with a clear error instead of crashing (#624). -
dbFetch()reports the server's message when a fetch fails with MariaDB Connector/C (#612). -
dbFetch()stops with a clear error when R code it calls,
such as an interrupt handler, closes its result or connection (#629). -
dbHasCompleted()anddbGetRowCount()followdbBind()of a query (#608).
Documentation
-
The README installs the development version with
pak::pak()(#556),
and replaces dead links to the client libraries (#561). -
?"Client-flags"explainsCLIENT_IGNORE_SPACEfor function names followed by a space (#649).
Chore
- RMariaDB requires DBI 1.4.0 or later.