summaryrefslogtreecommitdiff
path: root/src/backenddb/pg_update_otp.c
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-02-09 11:09:00 -0300
committerSebastian <sebasjm@gmail.com>2024-02-09 11:09:00 -0300
commit5cdcdfb2c4728f4c0afcebaad7041677cfdffcb6 (patch)
tree1bb6a740e94dc768b105ac6ba9f36116fd1b3f83 /src/backenddb/pg_update_otp.c
parente1d4b43af59fe8201e142103d4872c0727c2ca9e (diff)
downloadmerchant-5cdcdfb2c4728f4c0afcebaad7041677cfdffcb6.tar.gz
merchant-5cdcdfb2c4728f4c0afcebaad7041677cfdffcb6.tar.bz2
merchant-5cdcdfb2c4728f4c0afcebaad7041677cfdffcb6.zip
fix #8354
Diffstat (limited to 'src/backenddb/pg_update_otp.c')
-rw-r--r--src/backenddb/pg_update_otp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backenddb/pg_update_otp.c b/src/backenddb/pg_update_otp.c
index 8f6c7176..bdcb9624 100644
--- a/src/backenddb/pg_update_otp.c
+++ b/src/backenddb/pg_update_otp.c
@@ -51,7 +51,9 @@ TMH_PG_update_otp (void *cls,
GNUNET_PQ_query_param_string (td->otp_description),
GNUNET_PQ_query_param_uint32 (&pos32),
GNUNET_PQ_query_param_uint64 (&td->otp_ctr),
- GNUNET_PQ_query_param_string (td->otp_key),
+ (NULL == td->otp_key)
+ ? GNUNET_PQ_query_param_null()
+ : GNUNET_PQ_query_param_string (td->otp_key),
GNUNET_PQ_query_param_end
};
@@ -62,7 +64,7 @@ TMH_PG_update_otp (void *cls,
" otp_description=$3"
",otp_algorithm=$4"
",otp_ctr=$5"
- ",otp_key=$6"
+ ",otp_key=COALESCE($6,otp_key)"
" WHERE merchant_serial="
" (SELECT merchant_serial"
" FROM merchant_instances"