Skip to content

Syntax error with copy_to for MariaDB database backend #238

@colearendt

Description

@colearendt

I'm not 100% certain how to trace this any further. It looks like copy_to has trouble w/ SQL syntax for the MariaDB / MySQL connection. Using latest MariaDB docker image and the odbc package w/ the RStudio Pro drivers.

> tb <- copy_to(dbcon, testdata, "test2") %>% show_query()
Error: <SQL> 'ANALYZE `test2`'
  nanodbc/nanodbc.cpp:1587: 42000: [RStudio][MySQL] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`test2`' at line 1 
> tb <- copy_to(dbcon, testdata, "test2") %>% show_query()
Error: <SQL> 'CREATE TEMPORARY TABLE `test2` (
  `fld_factor` TEXT,
  `fld_datetime` TEXT,
  `fld_date` TEXT,
  `fld_time` TEXT,
  `fld_binary` INTEGER,
  `fld_integer` INTEGER,
  `fld_double` DOUBLE,
  `fld_character` TEXT,
  `fld_logical` INTEGER
)
'
  nanodbc/nanodbc.cpp:1587: 42S01: [RStudio][MySQL] Table 'test2' already exists 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorverb trans 🤖Translation of dplyr verbs to SQLwipwork in progress

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions