From 64bc1d24389db4f3572171054929cbedf2fb0b9a Mon Sep 17 00:00:00 2001 From: Ryan Schmukler Date: Tue, 13 Feb 2024 06:58:26 -0600 Subject: [PATCH] fix: error reporting on prepared statements (#16) Fixes an error where we would return an `Unknown Error` when we actually could determine the error. This makes debugging SQL statements *much* easier. --- src/tmducken/duckdb.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tmducken/duckdb.clj b/src/tmducken/duckdb.clj index 4559828..2581fe8 100644 --- a/src/tmducken/duckdb.clj +++ b/src/tmducken/duckdb.clj @@ -1111,7 +1111,7 @@ _unnamed [5 3]: stmt (Pointer. (long (stmt-ptr 0))) _ (when-not (== 0 tval) (let [errptr (duckdb-ffi/duckdb_prepare_error stmt) - errors (when errptr + errors (if errptr (dt-ffi/c->string errptr) "Unknown Error")] @destroy-prep*