Skip to content

Placeholders not working #848

@crimist

Description

@crimist

Issue description

Placeholders not working.

Example code

db, err := sql.Open("mysql", "root@/example")
if err != nil {
	log.Fatal(err)
}
if err := db.Ping(); err != nil {
	log.Fatal(err)
}
defer db.Close()

table := "test"

_, err = db.Exec("CREATE TABLE ? (x int)", table)
if err != nil {
	log.Fatal(err)
}

Error log

2018/08/21 16:15:03 Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? (x int)' at line 1

Configuration

Driver version (or git SHA): 99ff426eb706cffe92ff3d058e168b278cabf7c7

Go version: go1.10.3

Server version: mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

Server OS: macOS 10.13.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions