aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_select_refunds_above_serial_id.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-27 21:18:12 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-27 21:18:12 +0100
commit787c56e7e95744852594fc6ad08ae9368b79723a (patch)
tree64d0180fcfdcef6569297e3718b6b5143cea667d /src/exchangedb/pg_select_refunds_above_serial_id.c
parent26624bed95aaa29dcea00095e167f3d9ec0a129e (diff)
downloadexchange-787c56e7e95744852594fc6ad08ae9368b79723a.tar.xz
-add do_purse_delete API
Diffstat (limited to 'src/exchangedb/pg_select_refunds_above_serial_id.c')
-rw-r--r--src/exchangedb/pg_select_refunds_above_serial_id.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/exchangedb/pg_select_refunds_above_serial_id.c b/src/exchangedb/pg_select_refunds_above_serial_id.c
index a5f7d3df6..d8c87d7d4 100644
--- a/src/exchangedb/pg_select_refunds_above_serial_id.c
+++ b/src/exchangedb/pg_select_refunds_above_serial_id.c
@@ -178,7 +178,7 @@ TEH_PG_select_refunds_above_serial_id (
};
enum GNUNET_DB_QueryStatus qs;
- /* Fetch refunds with rowid '\geq' the given parameter */
+ /* Fetch refunds with rowid '\geq' the given parameter */
PREPARE (pg,
"audit_get_refunds_incr",
"SELECT"
@@ -200,6 +200,19 @@ TEH_PG_select_refunds_above_serial_id (
" ON (kc.denominations_serial=denom.denominations_serial)"
" WHERE ref.refund_serial_id>=$1"
" ORDER BY ref.refund_serial_id ASC;");
+ PREPARE (pg,
+ "test_refund_full",
+ "SELECT"
+ " CAST(SUM(CAST(ref.amount_with_fee_frac AS INT8)) AS INT8) AS s_f"
+ ",CAST(SUM(ref.amount_with_fee_val) AS INT8) AS s_v"
+ ",dep.amount_with_fee_val"
+ ",dep.amount_with_fee_frac"
+ " FROM refunds ref"
+ " JOIN deposits dep"
+ " ON (ref.coin_pub=dep.coin_pub AND ref.deposit_serial_id=dep.deposit_serial_id)"
+ " WHERE ref.refund_serial_id=$1"
+ " GROUP BY (dep.amount_with_fee_val, dep.amount_with_fee_frac);");
+
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
"audit_get_refunds_incr",
params,