diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-09 11:09:00 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-09 11:09:00 -0300 |
commit | 5cdcdfb2c4728f4c0afcebaad7041677cfdffcb6 (patch) | |
tree | 1bb6a740e94dc768b105ac6ba9f36116fd1b3f83 /src/backenddb/pg_update_otp.c | |
parent | e1d4b43af59fe8201e142103d4872c0727c2ca9e (diff) | |
download | merchant-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.c | 6 |
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" |