commit f29d26b8beb6c53b43be724f15dcae89bd3fd2c2
parent bea3e9676498339a464929fa64fb8d21da285a3e
Author: Sebastian <sebasjm@taler-systems.com>
Date: Sun, 25 Oct 2026 15:54:56 -0300
fix issue found also in 4f6b3258eb3ebca62080507c1af70c4d41725d1e
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/backenddb/update_account_last_bank_serial.c b/src/backenddb/update_account_last_bank_serial.c
@@ -40,11 +40,16 @@ TALER_MERCHANTDB_update_account_last_bank_serial (
GNUNET_assert (NULL != pg->current_merchant_id);
GNUNET_assert (0 == strcmp (instance,
pg->current_merchant_id));
+ /* Compare payto URIs with query parameters (such as 'receiver-name')
+ stripped. SPLIT_PART is used instead of REGEXP_REPLACE because the
+ previous regular expression ('\\?.*') matched an *optional* backslash
+ followed by anything, i.e. it matched at offset 0 and reduced every URI
+ to the empty string, making this condition always true. */
TMH_PQ_prepare_anon (pg,
"UPDATE merchant_accounts"
" SET last_bank_serial=$2"
- " WHERE REGEXP_REPLACE(payto_uri,'\\?.*','')"
- " =REGEXP_REPLACE(CAST ($1 AS TEXT),'\\?.*','')");
+ " WHERE SPLIT_PART(payto_uri,'?',1)"
+ " =SPLIT_PART(CAST ($1 AS TEXT),'?',1)");
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
"",
params);