File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 18
18
19
19
static int check_bind_pos (struct db_stmt * stmt , int pos )
20
20
{
21
- assert (pos == ++ stmt -> bind_pos );
21
+ if (pos == BIND_NEXT ) {
22
+ /* Don't mix BIND_NEXT with other args! */
23
+ assert (stmt -> bindings [stmt -> bind_pos + 1 ].type == DB_BINDING_UNINITIALIZED );
24
+ return ++ stmt -> bind_pos ;
25
+ }
26
+
27
+ /* Don't mix BIND_NEXT with other args! */
28
+ assert (stmt -> bind_pos == -1 );
29
+ assert (pos >= 0 );
30
+ assert (pos < tal_count (stmt -> bindings ));
22
31
return pos ;
23
32
}
24
33
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ struct onionreply;
17
17
struct wally_psbt ;
18
18
struct wally_tx ;
19
19
20
+ /* Magic pos argument meaning "the next field" */
21
+ #define BIND_NEXT -77
22
+
20
23
int db_col_is_null (struct db_stmt * stmt , const char * colname );
21
24
22
25
void db_bind_int (struct db_stmt * stmt , int pos , int val );
You can’t perform that action at this time.
0 commit comments