Skip to content

Commit

Permalink
Shim sql_escape_ident() for RMySQL
Browse files Browse the repository at this point in the history
Since it doesn't appear to handle SQL objects. Fixes childesr revdep failure.
  • Loading branch information
hadley committed Feb 29, 2024
1 parent fd01c3f commit 4708ae6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ S3method(sql_escape_datetime,DBIConnection)
S3method(sql_escape_datetime,MariaDBConnection)
S3method(sql_escape_datetime,MySQL)
S3method(sql_escape_datetime,MySQLConnection)
S3method(sql_escape_ident,MySQLConnection)
S3method(sql_escape_ident,TestConnection)
S3method(sql_escape_ident,default)
S3method(sql_escape_logical,"Microsoft SQL Server")
Expand Down
12 changes: 12 additions & 0 deletions R/backend-mysql.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ sql_escape_datetime.MySQLConnection <- sql_escape_datetime.MariaDBConnection
#' @export
sql_escape_datetime.MySQL <- sql_escape_datetime.MariaDBConnection


# dbQuoteIdentifier() for RMySQL lacks handling of SQL objects
#' @export
sql_escape_ident.MySQLConnection <- function(con, x) {
if (methods::is(x, "SQL")) {
x
} else {
DBI::dbQuoteIdentifier(con, x)
}
}


#' @export
supports_window_clause.MariaDBConnection <- function(con) {
TRUE
Expand Down

0 comments on commit 4708ae6

Please sign in to comment.