aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-04-10 10:52:45 +0200
committerChristian Grothoff <christian@grothoff.org>2023-04-10 10:52:45 +0200
commit27c9fef5ea725ad9b80acbf7f99f6fa6486d59c7 (patch)
treed72a427c03ecdf735c86ed9ce2b495a0aa9b702a /src/exchangedb
parent090c532b3adcf404c3b602c899c1e995762e0ace (diff)
use LEFT JOIN as aml_status table may be empty
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_lookup_kyc_requirement_by_row.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
index 9651359e2..6f9d76786 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
@@ -34,7 +34,7 @@ TEH_PG_lookup_kyc_requirement_by_row (
struct TALER_PaytoHashP *h_payto)
{
struct PostgresClosure *pg = cls;
- uint32_t status;
+ uint32_t status = TALER_AML_NORMAL;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&requirement_row),
GNUNET_PQ_query_param_end
@@ -44,8 +44,10 @@ TEH_PG_lookup_kyc_requirement_by_row (
requirements),
GNUNET_PQ_result_spec_auto_from_type ("h_payto",
h_payto),
- GNUNET_PQ_result_spec_uint32 ("status",
- &status),
+ GNUNET_PQ_result_spec_allow_null (
+ GNUNET_PQ_result_spec_uint32 ("status",
+ &status),
+ NULL),
GNUNET_PQ_result_spec_end
};
enum GNUNET_DB_QueryStatus qs;
@@ -57,7 +59,7 @@ TEH_PG_lookup_kyc_requirement_by_row (
",lr.h_payto"
",aml.status"
" FROM legitimization_requirements lr"
- " JOIN aml_status aml USING (h_payto)"
+ " LEFT JOIN aml_status aml USING (h_payto)"
" WHERE legitimization_requirement_serial_id=$1;");
qs = GNUNET_PQ_eval_prepared_singleton_select (
pg->conn,