mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
db: Fix a syntax error with the optional parameters
SQL doesn't really allow `a OR 1` as a clause since `1` is not a boolean expression. Moving it into `a OR 1=1` however is valid again.
This commit is contained in:
committed by
Rusty Russell
parent
8d3861ee29
commit
b9c602c7e4
@@ -3371,7 +3371,9 @@ wallet_payment_list(const tal_t *ctx,
|
|||||||
", partid"
|
", partid"
|
||||||
", local_offer_id"
|
", local_offer_id"
|
||||||
" FROM payments"
|
" FROM payments"
|
||||||
" WHERE (payment_hash = ? OR ?) AND (status = ? OR ?)"
|
" WHERE"
|
||||||
|
" (payment_hash = ? OR 1=?) AND"
|
||||||
|
" (status = ? OR 1=?)"
|
||||||
" ORDER BY id;"));
|
" ORDER BY id;"));
|
||||||
|
|
||||||
if (payment_hash)
|
if (payment_hash)
|
||||||
|
|||||||
Reference in New Issue
Block a user