Problem with MySQL cast

Simple cast emits SQL not accepted by MySQL.

Submitted as dplyr issue 2775 as dbplyr currently asks that issues be filed there.

# devtools::install_github("tidyverse/dplyr")
# devtools::install_github('tidyverse/dbplyr')
suppressPackageStartupMessages(library('dplyr'))
packageVersion("dplyr")
if(requireNamespace("dbplyr", quietly = TRUE)) {
  packageVersion("dbplyr")
}
R.Version()$version.string

sc <- dplyr::src_mysql('mysql', 
                       '127.0.0.1', 
                       3306, 
                       'root', 'passwd')
d1 <- copy_to(sc, data.frame(x=1:3), 'd1')

# works, Note PostgreSQL needs this form 
# or it doesn't know type of newCol
mutate(d1, newCol= 'a')

# throws
mutate(d1, newCol= as.character('a'))
rm(list=ls())
gc(verbose = FALSE)


WinVector/replyr documentation built on Oct. 22, 2020, 8:07 p.m.