Skip to content

Cannot load empty csv file to mysql #539

Closed
@wxlARG

Description

@wxlARG

Issue description

We meet a hang issue when we want to load an empty csv file to mysql.

Example code

db, err := sql.Open("mysql", "user:password@tcp(127.0.0.1:3306)/{db_name}?charset=utf8&parseTime=true&loc=UTC&allowAllFiles=true")
query := `load data local infile './empty.csv' into table {table_name} character set utf8 fields terminated by ',' enclosed by '"' escaped by '\\' lines terminated by '\n'`
_, err = db.Exec(query)

Error log

Configuration

Driver version (or git SHA):
master 2e00b5c
Go version: run go version in your console
go1.6.3 linux/amd64
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
MySQL 5.7
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
Red Hat Enterprise Linux Server release 7.1 (Maipo)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions