diff --git a/devtools/sql-rewrite.py b/devtools/sql-rewrite.py index c7458fbcb..b313c2c4a 100755 --- a/devtools/sql-rewrite.py +++ b/devtools/sql-rewrite.py @@ -77,7 +77,7 @@ def extract_queries(pofile): query = c[i][7:][:-1] queries.append({ - 'name': name, + 'name': query, 'query': query, 'placeholders': query.count('?'), 'readonly': "true" if query.upper().startswith("SELECT") else "false", diff --git a/wallet/db.c b/wallet/db.c index 926352c99..f3b689e20 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -502,7 +502,7 @@ struct db_stmt *db_prepare_v2_(const char *location, struct db *db, /* Look up the query by its ID */ for (size_t i = 0; i < db->config->num_queries; i++) { - if (streq(query_id, db->config->queries[i].query)) { + if (streq(query_id, db->config->queries[i].name)) { stmt->query = &db->config->queries[i]; break; } diff --git a/wallet/db.h b/wallet/db.h index 2444c1772..59ec244ab 100644 --- a/wallet/db.h +++ b/wallet/db.h @@ -40,7 +40,7 @@ struct db; * devtools/sql-rewrite.py needs to change as well, since they need to * generate identical names to work correctly. */ -#define SQL(x) NAMED_SQL( __FILE__ ":" stringify(__LINE__) ":" stringify(__COUNTER__), x) +#define SQL(x) NAMED_SQL( __FILE__ ":" stringify(__COUNTER__), x) /** diff --git a/wallet/db_common.h b/wallet/db_common.h index 7b570a7ce..127485e56 100644 --- a/wallet/db_common.h +++ b/wallet/db_common.h @@ -55,7 +55,7 @@ enum db_binding_type { struct db_binding { enum db_binding_type type; union { - int i; + s32 i; u64 u64; const char* text; const u8 *blob;