RMySQL icon indicating copy to clipboard operation
RMySQL copied to clipboard

dbColumnInfo causes a crash

Open stla opened this issue 7 years ago • 2 comments

R crashes if one applies the function dbColumnInfo to a request like ALTER :

library(RMySQL)
DB <- dbConnect(MySQL(), user="root", host="localhost", password="xxx", dbname="rmysql0")
# write a data frame to the database
dat1 <- data.frame(
  Name = c("Joe", "Joe", "Bill", "Jim", "Kate"),
  Value = c(10.1, 13, 9, 7.7, -3),
  Indic = c(0L, 1L, 1L, 2L, 2L),
  Status = c(TRUE, TRUE, TRUE, FALSE, FALSE)
)
dbWriteTable(DB, "dat1", dat1, row.names=FALSE)
# send query
res <- dbSendQuery(DB, "ALTER TABLE `dat1` DROP COLUMN `Name`")
dbGetStatement(res) # works fine
dbColumnInfo(res) # crash

stla avatar Jul 25 '16 16:07 stla

Thanks, and sorry for the slow reply. Have you installed RMySQL from CRAN or from GitHub?

krlmlr avatar Jun 30 '17 12:06 krlmlr

Hmm, that's old. I didn't remember that. I don't use RMySQL anymore, this was just to write an article on my blog. But this was the CRAN version.

stla avatar Jun 30 '17 12:06 stla