Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 3 tasks
davidshiz opened this issue Jan 11, 2023 · 0 comments · Fixed by #1273
Closed
2 of 3 tasks

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

davidshiz opened this issue Jan 11, 2023 · 0 comments · Fixed by #1273
Assignees
Labels
A-bug Something isn't working B-loader load data to stonedb B-storage data type, data storage, insert,update,delete, transactions prio: high High priority

Comments

@davidshiz
Copy link
Collaborator

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!
@davidshiz davidshiz added the A-bug Something isn't working label Jan 11, 2023
@lujiashun lujiashun self-assigned this Jan 11, 2023
@wisehead wisehead added the B-loader load data to stonedb label Jan 12, 2023
@wisehead wisehead added this to the stonedb_5.7_v1.0.3 milestone Jan 12, 2023
@wisehead wisehead added the prio: high High priority label Jan 30, 2023
@hustjieke hustjieke added the B-storage data type, data storage, insert,update,delete, transactions label Jan 30, 2023
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 6, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 6, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 7, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 7, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 7, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 7, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 20, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Feb 20, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
@mergify mergify bot closed this as completed in #1273 Feb 20, 2023
mergify bot pushed a commit that referenced this issue Feb 20, 2023
[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
mergify bot pushed a commit that referenced this issue Feb 27, 2023
[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…neatom#1209)

[summary]
1. support few column;
2. support too many column;
3. support the data of column is not completed,such as
3.1 such as start with the enclosed char, finished without enclosed char;
3.2 without line-termination string, but reach to the end of file;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working B-loader load data to stonedb B-storage data type, data storage, insert,update,delete, transactions prio: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants