diff --git a/NAMESPACE b/NAMESPACE index d7e2931e1..b2e724c54 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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") diff --git a/R/backend-mysql.R b/R/backend-mysql.R index 2cf4ab963..427c33f19 100644 --- a/R/backend-mysql.R +++ b/R/backend-mysql.R @@ -263,6 +263,20 @@ 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 (!isS4(con)) { # for simulate_mysql() + NextMethod() + } else if (methods::is(x, "SQL")) { + x + } else { + DBI::dbQuoteIdentifier(con, x) + } +} + + #' @export supports_window_clause.MariaDBConnection <- function(con) { TRUE