aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-28 18:01:49 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-29 12:18:50 +0200
commit6c34722457db8ecd0c13db87e6ebf5b8595cd9a0 (patch)
treed2e32678e01a6fb720be590366a4932f2e50844a /src/exchangedb
parent069f30ba323b952a17e89adfebc23dacf415a1c8 (diff)
-bugfixes
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_select_aml_decisions.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/src/exchangedb/pg_select_aml_decisions.c b/src/exchangedb/pg_select_aml_decisions.c
index e7603384c..c817e443f 100644
--- a/src/exchangedb/pg_select_aml_decisions.c
+++ b/src/exchangedb/pg_select_aml_decisions.c
@@ -174,42 +174,44 @@ TEH_PG_select_aml_decisions (
PREPARE (pg,
"select_aml_decisions_inc",
"SELECT"
- " outcome_serial_id"
- ",h_payto"
- ",justification"
- ",decision_time"
- ",expiration_time"
- ",jproperties"
- ",to_investigate"
- ",is_active"
- ",jnew_rules"
- " FROM legitimization_outcomes"
- " WHERE outcome_serial_id > $7"
- " ($1 OR (h_payto = $2)) AND"
- " ($3 OR (investigation = $4)) AND"
- " ($5 OR (active = $6))"
- " ORDER BY outcome_serial_id ASC"
+ " lo.outcome_serial_id"
+ ",lo.h_payto"
+ ",ah.justification"
+ ",lo.decision_time"
+ ",lo.expiration_time"
+ ",lo.jproperties"
+ ",lo.to_investigate"
+ ",lo.is_active"
+ ",lo.jnew_rules"
+ " FROM legitimization_outcomes lo"
+ " LEFT JOIN aml_history ah"
+ " USING (outcome_serial_id)"
+ " WHERE (outcome_serial_id > $7)"
+ " AND ($1 OR (lo.h_payto = $2))"
+ " AND ($3 OR (lo.to_investigate = $4))"
+ " AND ($5 OR (lo.is_active = $6))"
+ " ORDER BY lo.outcome_serial_id ASC"
" LIMIT $8");
PREPARE (pg,
"select_aml_decisions_dec",
"SELECT"
- " outcome_serial_id"
- ",h_payto"
- ",justification"
- ",decision_time"
- ",expiration_time"
- ",jproperties"
- ",to_investigate"
- ",is_active"
- ",jnew_rules"
- " FROM legitimization_outcomes"
- " LEFT JOIN aml_history"
- " ON (outcome_serial_id)"
- " WHERE outcome_serial_id < $7"
- " ($1 OR (h_payto = $2)) AND"
- " ($3 OR (investigation = $4)) AND"
- " ($5 OR (active = $6))"
- " ORDER BY outcome_serial_id DESC"
+ " lo.outcome_serial_id"
+ ",lo.h_payto"
+ ",ah.justification"
+ ",lo.decision_time"
+ ",lo.expiration_time"
+ ",lo.jproperties"
+ ",lo.to_investigate"
+ ",lo.is_active"
+ ",lo.jnew_rules"
+ " FROM legitimization_outcomes lo"
+ " LEFT JOIN aml_history ah"
+ " USING (outcome_serial_id)"
+ " WHERE lo.outcome_serial_id < $7"
+ " AND ($1 OR (lo.h_payto = $2))"
+ " AND ($3 OR (lo.to_investigate = $4))"
+ " AND ($5 OR (lo.is_active = $6))"
+ " ORDER BY lo.outcome_serial_id DESC"
" LIMIT $8");
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
stmt,