Skip to content

bug: LOAD data statement with LINES TERMINATED return error #1209

@davidshiz

Description

@davidshiz

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

root@ub01:~# cat 1.csv
1,chai;2,测试;3,chayicha;

CREATE TABLE `t1` (
  `id` int(11) DEFAULT NULL,
  `a` char(20) DEFAULT NULL
)DEFAULT CHARSET=utf8mb4;

mysql> LOAD DATA LOCAL infile '~/1.csv' into table t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY ';';
ERROR 5 (HY000): Data format error. Row: 4 Column: 2

Expected behavior

mysql> LOAD DATA LOCAL infile '~/1.csv' into table t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY ';';
Query OK, 4 rows affected, 2 warnings (0.00 sec)
Records: 4  Deleted: 0  Skipped: 0  Warnings: 2

mysql> select * from t1;
+------+----------+
| id   | a        |
+------+----------+
|    1 | chai     |
|    2 | 测试     |
|    3 | chayicha |
|    0 | NULL     |
+------+----------+

How To Reproduce

root@ub01:~# cat 1.csv
1,chai;2,测试;3,chayicha;

CREATE TABLE `t1` (
  `id` int(11) DEFAULT NULL,
  `a` char(20) DEFAULT NULL
)DEFAULT CHARSET=utf8mb4;
LOAD DATA LOCAL infile '~/1.csv' into table t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY ';';

Environment

root@ub01:~# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/hustjieke/stonedb.git:feat_unsigned_support
        Branch name: feat_unsigned_support
        Last commit ID: 2fb620d93
        Last commit time: Date:   Thu Jan 5 12:51:05 2023 +0000
        Build time: Date: Fri Jan  6 18:16:48 CST 2023
root@ub01:~# cat /etc/issue
Ubuntu 20.04.5 LTS \n \l

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!

Metadata

Metadata

Assignees

Labels

A-bugSomething isn't workingB-loaderload data to stonedbB-storagedata type, data storage, insert,update,delete, transactionsprio: highHigh priority

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions