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

Can not insert duckdb temp table into mysql table #87

Closed
2 tasks done
kekec14 opened this issue Sep 12, 2024 · 0 comments · Fixed by #88
Closed
2 tasks done

Can not insert duckdb temp table into mysql table #87

kekec14 opened this issue Sep 12, 2024 · 0 comments · Fixed by #88

Comments

@kekec14
Copy link

kekec14 commented Sep 12, 2024

What happens?

Hello!

I need to insert duckdb temp table with name duckdb_temp_table into existing mysql table with name table_name.

I get an error:
IO Error: Failed to run query "INSERT INTO izvozi.table_name (tip, date of bill) VALUES (100.0, '2022-01-05')": 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 'of bill) VALUES (100.0,'2022-01-05 00:00:00')' at line 1

According to an error, I think problem is backtick (`), which is not used in column names.

Do I miss some configuration parameter or is this a bug which occures when INSERT INTO BY NAME is used?

Thank you!

To Reproduce

duckdb_temp_table :

│  tip│ date of bill │
│ int32 │     date     │
├───────┼──────────────┤
│   100 │ 2022-01-05 

mysql insert statement:
INSERT INTO mysql_db.table_name by name ( SELECT * FROM temp_table );

OS:

Windows

MySQL Version:

8.0.39

DuckDB Version:

v1.0.0 1f98600c2c

DuckDB Client:

CLI

Full Name:

dp

Affiliation:

mysql

Have you tried this on the latest main branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
Mytherin added a commit to Mytherin/duckdb_mysql that referenced this issue Sep 16, 2024
Mytherin added a commit that referenced this issue Sep 17, 2024
Fix #87 - correctly quote column identifiers in INSERT INTO statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant