Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Commit ac1c894

Browse files
committed
db: Get old sqlite3_trace based db_changes working again
Seems I accidentally broke the fallback mechanism while working on the DB abstraction.
1 parent c5f4c9c commit ac1c894

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wallet/db_sqlite3.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
/* Prior to sqlite3 v3.14, we have to use tracing to dump statements */
1212
static void trace_sqlite3(void *stmtv, const char *stmt)
1313
{
14-
struct db_stmt = (struct db_stmt*)stmtv;
15-
db_changes_add(stmt, stmt);
14+
struct db_stmt *s = (struct db_stmt*)stmtv;
15+
db_changes_add(s, stmt);
1616
}
1717
#endif
1818

@@ -86,7 +86,7 @@ static bool db_sqlite3_exec(struct db_stmt *stmt)
8686
#if !HAVE_SQLITE3_EXPANDED_SQL
8787
/* Register the tracing function if we don't have an explicit way of
8888
* expanding the statement. */
89-
sqlite3_trace(db->sql, trace_sqlite3, stmt);
89+
sqlite3_trace(stmt->db->conn, trace_sqlite3, stmt);
9090
#endif
9191

9292
if (!db_sqlite3_query(stmt)) {
@@ -110,7 +110,7 @@ static bool db_sqlite3_exec(struct db_stmt *stmt)
110110
#else
111111
/* Unregister the trace callback to avoid it accessing the potentially
112112
* stale pointer to stmt */
113-
sqlite3_trace(db->sql, NULL, NULL);
113+
sqlite3_trace(stmt->db->conn, NULL, NULL);
114114
#endif
115115

116116
return true;

0 commit comments

Comments
 (0)