NULL value fixed in batch 1 test

This commit is contained in:
Joseph 2022-12-21 10:25:44 -05:00
parent f2b1041925
commit 0a40f48400
No known key found for this signature in database
GPG Key ID: E709789D3076B5CC
2 changed files with 15 additions and 17 deletions

View File

@ -253,6 +253,4 @@ BEGIN
RETURN; RETURN;
END $$; END $$;

View File

@ -54,11 +54,11 @@ compute_notify_on_reserve (const struct TALER_ReservePublicKeyP *reserve_pub)
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
insert1(struct PostgresClosure *pg, insert1(struct PostgresClosure *pg,
const struct TALER_EXCHANGEDB_ReserveInInfo *reserve, const struct TALER_EXCHANGEDB_ReserveInInfo reserves[1],
struct GNUNET_TIME_Timestamp expiry, struct GNUNET_TIME_Timestamp expiry,
struct GNUNET_TIME_Timestamp gc, struct GNUNET_TIME_Timestamp gc,
struct TALER_PaytoHashP h_payto, struct TALER_PaytoHashP h_payto,
const char *notify_s, char *const * notify_s,
struct GNUNET_TIME_Timestamp reserve_expiration, struct GNUNET_TIME_Timestamp reserve_expiration,
bool *transaction_duplicate, bool *transaction_duplicate,
bool *conflict, bool *conflict,
@ -75,31 +75,31 @@ insert1(struct PostgresClosure *pg,
" ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);"); " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);");
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (reserve->reserve_pub), GNUNET_PQ_query_param_auto_from_type (reserves[0].reserve_pub),
GNUNET_PQ_query_param_timestamp (&expiry), GNUNET_PQ_query_param_timestamp (&expiry),
GNUNET_PQ_query_param_timestamp (&gc), GNUNET_PQ_query_param_timestamp (&gc),
GNUNET_PQ_query_param_uint64 (&reserve->wire_reference), GNUNET_PQ_query_param_uint64 (&reserves[0].wire_reference),
TALER_PQ_query_param_amount (reserve->balance), TALER_PQ_query_param_amount (reserves[0].balance),
GNUNET_PQ_query_param_string (reserve->exchange_account_name), GNUNET_PQ_query_param_string (reserves[0].exchange_account_name),
GNUNET_PQ_query_param_timestamp (&reserve->execution_time), GNUNET_PQ_query_param_timestamp (&reserves[0].execution_time),
GNUNET_PQ_query_param_auto_from_type (&h_payto), GNUNET_PQ_query_param_auto_from_type (&h_payto),
GNUNET_PQ_query_param_string (reserve->sender_account_details), GNUNET_PQ_query_param_string (reserves[0].sender_account_details),
GNUNET_PQ_query_param_timestamp (&reserve_expiration), GNUNET_PQ_query_param_timestamp (&reserve_expiration),
GNUNET_PQ_query_param_string (notify_s), GNUNET_PQ_query_param_string (notify_s[0]),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_bool ("conflicted", GNUNET_PQ_result_spec_bool ("conflicted",
conflict), &conflict[0]),
GNUNET_PQ_result_spec_bool ("transaction_duplicate", GNUNET_PQ_result_spec_bool ("transaction_duplicate",
transaction_duplicate), &transaction_duplicate[0]),
GNUNET_PQ_result_spec_uint64 ("reserve_uuid", GNUNET_PQ_result_spec_uint64 ("reserve_uuid",
reserve_uuid), &reserve_uuid[0]),
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
}; };
TALER_payto_hash (reserve->sender_account_details, TALER_payto_hash (reserves[0].sender_account_details,
&h_payto); &h_payto);
/* Note: query uses 'on conflict do nothing' */ /* Note: query uses 'on conflict do nothing' */
@ -117,7 +117,7 @@ insert1(struct PostgresClosure *pg,
} }
GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != qs2); GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != qs2);
if ((*conflict) && (*transaction_duplicate)) if (conflict[0] && transaction_duplicate[0])
{ {
GNUNET_break (0); GNUNET_break (0);
TEH_PG_rollback (pg); TEH_PG_rollback (pg);
@ -772,7 +772,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
expiry, expiry,
gc, gc,
h_payto, h_payto,
notify_s[i], &notify_s[i],
reserve_expiration, reserve_expiration,
&transaction_duplicate[i], &transaction_duplicate[i],
&conflicts[i], &conflicts[i],