Giorgi / DuckDB.NET

Bindings and ADO.NET Provider for DuckDB
https://duckdb.net
MIT License
356 stars 62 forks source link

Error strings appear mangled #37

Closed pkese closed 2 years ago

pkese commented 2 years ago

When trying to send a SQL insert, I'm getting mangled error strings:

One or more errors occurred. (�-��  V)
Unhandled exception. System.AggregateException: One or more errors occurred. (�-��  V)
 ---> DuckDB.NET.Data.DuckDBException (0x00000001): �-��    V
   at DuckDB.NET.Data.DuckDbCommand.ExecuteScalarOrNonQuery()
   at DuckDB.NET.Data.DuckDbCommand.ExecuteNonQuery()

Maybe there's actually something wrong with my insert statement, so no need to worry about inserts not working, just the text appears wrong (however the same SQL command works fine on sqlite, but then again the SQL syntax is not exactly the same between duckdb and sqlite).

This is with DuckDB.Net 0.4.0 and latest duckdb.so (on Linux).

And I should use this occasion to thank you very much for all your updates & commits.

Giorgi commented 2 years ago

Can you upload a small repro?

The credits for the latest release go to @kmosegaard

Giorgi commented 2 years ago

I can reproduce it in WSL too, no need for repro.

kmosegaard commented 2 years ago

Something is not aligning correctly.

If I change: private string ErrorMessage; to: private IntPtr ErrorMessage; in DuckDBResult.

I get the expected result.

Giorgi commented 2 years ago

@kmosegaard That solves the problem indeed!

Giorgi commented 2 years ago

@pkese This is now available on NuGet