From ed77edf4c6daade7cb38c42acb8185e5cffca11e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 14 Aug 2025 10:57:52 +0930 Subject: [PATCH] db: better diagnostics when a query fails. Print the error! Signed-off-by: Rusty Russell --- db/utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/utils.c b/db/utils.c index b73fda396..70389907a 100644 --- a/db/utils.c +++ b/db/utils.c @@ -153,8 +153,7 @@ bool db_query_prepared_canfail(struct db_stmt *stmt) void db_query_prepared(struct db_stmt *stmt) { if (!db_query_prepared_canfail(stmt)) - db_fatal(stmt->db, "query failed: %s: %s", - stmt->location, stmt->query->query); + db_fatal(stmt->db, "query failed: %s", stmt->error); } bool db_step(struct db_stmt *stmt)