db/bindings: now bindings are always in order, remove index.

Simply always bind the next one.  No arithmetic required now!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-07-14 09:58:46 +09:30
parent 9af407a47a
commit 0bcff1e76d
10 changed files with 804 additions and 816 deletions

View File

@@ -136,7 +136,7 @@ static bool db_migrate(struct plugin *p, struct db *db, bool *created)
/* Finally, update the version number in the version table */
stmt = db_prepare_v2(db, SQL("UPDATE version SET version=?;"));
db_bind_int(stmt, BIND_NEXT, available);
db_bind_int(stmt, available);
db_exec_prepared_v2(take(stmt));
return current != orig;
@@ -179,7 +179,7 @@ static void migration_remove_dupe_lease_fees(struct plugin *p, struct db *db)
/* same acct as last, we found a duplicate */
del_stmt = db_prepare_v2(db, SQL("DELETE FROM channel_events"
" WHERE id=?"));
db_bind_u64(del_stmt, BIND_NEXT, id);
db_bind_u64(del_stmt, id);
db_exec_prepared_v2(take(del_stmt));
}
tal_free(stmt);