aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-03-06 22:02:38 +0100
committerChristian Grothoff <christian@grothoff.org>2024-03-06 22:02:38 +0100
commit9173d2747f00921dccf1678b877f7f250fca9cd3 (patch)
tree70067c458dffe99443d6675e107e1b32206eb4ae /src/exchangedb
parent7d40a312835d2ce3ab93ef10189c70123421b222 (diff)
psql reproducerpostgres-bug-mergejoin
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_lookup_transfer_by_deposit.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/exchangedb/pg_lookup_transfer_by_deposit.c b/src/exchangedb/pg_lookup_transfer_by_deposit.c
index 425a11d3c..cb600f080 100644
--- a/src/exchangedb/pg_lookup_transfer_by_deposit.c
+++ b/src/exchangedb/pg_lookup_transfer_by_deposit.c
@@ -141,36 +141,43 @@ TEH_PG_lookup_transfer_by_deposit (
&wire_salt),
GNUNET_PQ_result_spec_string ("payto_uri",
&payto_uri),
+#define BUG 1
+#if BUG
GNUNET_PQ_result_spec_allow_null (
GNUNET_PQ_result_spec_uint64 ("legitimization_requirement_serial_id",
&kyc->requirement_row),
NULL),
+#endif
GNUNET_PQ_result_spec_allow_null (
GNUNET_PQ_result_spec_uint64 ("kyc_requirement",
&aml_kyc_row),
NULL),
+ GNUNET_PQ_result_spec_allow_null (
+ GNUNET_PQ_result_spec_uint32 ("status",
+ &status32),
+ NULL),
TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee",
amount_with_fee),
TALER_PQ_RESULT_SPEC_AMOUNT ("fee_deposit",
deposit_fee),
GNUNET_PQ_result_spec_timestamp ("wire_deadline",
exec_time),
- GNUNET_PQ_result_spec_allow_null (
- GNUNET_PQ_result_spec_uint32 ("status",
- &status32),
- NULL),
GNUNET_PQ_result_spec_end
};
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Got the special place...\n");
PREPARE (pg,
"get_deposit_without_wtid",
"SELECT"
- " agt.legitimization_requirement_serial_id"
- ",bdep.wire_salt"
+ " bdep.wire_salt"
",wt.payto_uri"
",cdep.amount_with_fee"
",denom.fee_deposit"
",bdep.wire_deadline"
+#if BUG
+ ",agt.legitimization_requirement_serial_id"
+#endif
",aml.status"
",aml.kyc_requirement"
" FROM coin_deposits cdep"
@@ -182,9 +189,11 @@ TEH_PG_lookup_transfer_by_deposit (
" ON (kc.coin_pub = cdep.coin_pub)"
" JOIN denominations denom"
" USING (denominations_serial)"
+#if BUG
" LEFT JOIN aggregation_transient agt "
" ON ( (bdep.wire_target_h_payto = agt.wire_target_h_payto) AND"
" (bdep.merchant_pub = agt.merchant_pub) )"
+#endif
" LEFT JOIN aml_status aml"
" ON (wt.wire_target_h_payto = aml.h_payto)"
" WHERE cdep.coin_pub=$1"
@@ -215,12 +224,15 @@ TEH_PG_lookup_transfer_by_deposit (
TALER_merchant_wire_signature_hash (payto_uri,
&wire_salt,
&wh);
- GNUNET_PQ_cleanup_result (rs);
if (0 !=
GNUNET_memcmp (&wh,
h_wire))
+ {
+ GNUNET_PQ_cleanup_result (rs);
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
+ }
}
+ GNUNET_PQ_cleanup_result (rs);
*aml_decision = TALER_AML_NORMAL;
return qs;
}