-
Notifications
You must be signed in to change notification settings - Fork 281
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 inline
does not work when specifying fields enclosed by '"'
by throwing an error ERROR 20301 (HY000): invalid input: csvParser error: unterminated quoted field
#16794
Comments
#16790 is stuck by this issue. |
@aronchanisme load data infile是能正确支持的, 我看了一下文档load data inline是没有那些 terminated by enclosed by lines terminated by 之类的说明的, load data inline可能是没有做这些解析的. 莫尘当时做这个东西的时候可能就没打算支持这些东西 |
not working ont it |
之前改的有问题,csvparser这块还要再看一下 |
这个load data inline失败,load data infile成功,是因为$XXX$ "zhangsan","26","Shanxi" |
Syntax issue. Doc needs to be updated. root@test0:~# mo_ctl connect
2024-08-28 15:55:00.321 UTC+0800 [INFO] Checking connectivity
2024-08-28 15:55:00.368 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9087
Server version: 8.0.30-MatrixOne-v1.2.2 MatrixOne
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> create table t2(name varchar(25),age int,city varchar(25));
Query OK, 0 rows affected (0.02 sec)
mysql> load data inline format='csv', data=$XXX$"zhangsan","26","Shanxi;XiAn"$XXX$ into table t2 fields terminated by ',' enclosed by '"' lines terminated by '\n' (name,age,city);
Query OK, 1 row affected (0.01 sec)
mysql> select * from t2;
+----------+------+-------------+
| name | age | city |
+----------+------+-------------+
| zhangsan | 26 | Shanxi;XiAn |
+----------+------+-------------+
1 row in set (0.00 sec)
mysql> load data inline format='csv', data=$XXX$ "zhangsan","26","Shanxi;XiAn" $XXX$ into table t2 fields terminated by ',' enclosed by '"' lines terminated by '\n' (name,age,city);
ERROR 20301 (HY000): invalid input: csvParser error: unterminated quoted field
mysql> select git_version();
+---------------+
| git_version() |
+---------------+
| 74f81f7 |
+---------------+
1 row in set (0.00 sec) |
跟产品和测试对齐了,保持现状,不用修改了 |
Doc request : matrixorigin/matrixorigin.io#589 |
Is there an existing issue for the same bug?
Branch Name
1.2-dev
Commit ID
a5c552e
Other Environment Information
Actual Behavior
load data inline
does not work when specifyingfields enclosed by '"'
by throwing an errorERROR 20301 (HY000): invalid input: csvParser error: unterminated quoted field
Expected Behavior
Given an csv file, which contains content like this
Both mo and mysql can
load data local infile
from the csv file and put data into the table successfully, however mo'sload data inline
way to load the data directly from sql statement failed. The expectation is below sql worksExpected result of a
select * from test.user
after the load:Steps to Reproduce
Additional information
#16790
The text was updated successfully, but these errors were encountered: