duckdb / duckdb_mysql

https://duckdb.org/docs/extensions/mysql
MIT License
55 stars 13 forks source link

Error in SQL syntax for UPDATE with certain field types #93

Open rynoV opened 3 weeks ago

rynoV commented 3 weeks ago

What happens?

When running an update query with a mysql target table, the generated mysql code appears to be invalid:

DuckDB.NET.Data.DuckDBException (0x0000001C): IO Error: Failed to run query "<query>": 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
 '::<duckdb type>, ...' at line 1

To Reproduce

Have a table in mysql with a binary column and run

update mysql.t set blob_col = '00000000-0000-0000-0000-000000000000'::BLOB;

Same issue comes up when replacing BLOB with DATE and TIMESTAMP WITH TIME ZONE (might be more, those are the ones I've checked)

OS:

Windows 11

MySQL Version:

8.0.35

DuckDB Version:

1.1.1

DuckDB Client:

DuckDB.NET, jdbc, probably doesn't matter

Full Name:

Calum Sieppert

Affiliation:

Auspice Capital

Have you tried this on the latest main branch?

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

rynoV commented 3 weeks ago

The same issue seems to be present for delete statements