Closed ywyt738 closed 7 months ago
Hi @ywyt738 thanks for opening this issue. Please clarify the following:
Hi @szarnyasg
I'm using mysql extension.
Here is an MWE:
# create a table in local file database
create table t1 (v varchar);
# insert a data
insert table t1 value ('\');
# attach a mysql
attach 'host=localhost user=root database=mysqldb' as mysql_db (type mysql_scanner);
# use database
use mysql_db;
# create table in mysql from local database table "t1"
create table t1 as from db.t1;
The error is
IO Error: Failed to run query "INSERT INTO `mysqldb`.`t1` VALUES ('\')": 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 ''\')' at line 1
@ywyt738 thanks! I transferred the issue to the duckdb_mysql
repository. We'll take a look.
Past week I suffered from a data integrity issue where strings like 12345\0123
had the \0
replaced by the null character and strings like R\L
lost the backslash while copying data from a CSV to MySQL through DuckDB. I have only noticed it because of a trailing backslash in one of these input strings, which broke the process the same way described in this issue.
Thanks for reporting! I've pushed a fix in https://github.com/duckdb/duckdb_mysql/commit/8253d614d2601c369652721206498b10a59ae0bf.
What happens?
If my field's value is \ , it can not be imported to mysql with COPY command. Because the import sql is
The sql will report syntax error.
To Reproduce
OS:
linux & mac
DuckDB Version:
0.10.1
DuckDB Client:
cli
Full Name:
Xiaojun Huang
Affiliation:
MHP
Have you tried this on the latest nightly build?
I have not tested with any build
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?