diff --git a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql index 2100f7de6..f34a5bcfa 100644 --- a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql @@ -122,10 +122,6 @@ BEGIN END IF; END IF; CLOSE curs_reserve_exist; - IF out_reserve_found AND out_reserve_found2 - THEN - RETURN; - END IF; PERFORM pg_notify(in_notify, NULL); PERFORM pg_notify(in2_notify, NULL); diff --git a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql index 15d8ef6ff..ae7bee18f 100644 --- a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql @@ -170,13 +170,7 @@ BEGIN k=k+1; END LOOP; CLOSE curs_reserve_exist; - IF out_reserve_found - AND out_reserve_found2 - AND out_reserve_found3 - AND out_reserve_found4 - THEN - RETURN; - END IF; + PERFORM pg_notify(in_notify, NULL); PERFORM pg_notify(in2_notify, NULL); diff --git a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql index 6076f3299..aa0322f44 100644 --- a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql @@ -289,17 +289,6 @@ BEGIN END LOOP; CLOSE curs_reserve_existed; - IF out_reserve_found - AND out_reserve_found2 - AND out_reserve_found3 - AND out_reserve_found4 - AND out_reserve_found5 - AND out_reserve_found6 - AND out_reserve_found7 - AND out_reserve_found8 - THEN - RETURN; - END IF; PERFORM pg_notify(in_notify, NULL); PERFORM pg_notify(in2_notify, NULL); diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql index 4ae7f68a2..d86bd1ee7 100644 --- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql @@ -67,7 +67,6 @@ transaction_duplicate= TRUE; ELSE -- We made no change, which means the reserve existed. out_reserve_found = TRUE; - RETURN; END IF; PERFORM pg_notify(in_notify, NULL); INSERT INTO reserves_in @@ -91,13 +90,11 @@ transaction_duplicate= TRUE; THEN -- HAPPY PATH THERE IS NO DUPLICATE TRANS transaction_duplicate = FALSE; - RETURN; ELSE -- Unhappy... RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict'; transaction_duplicate = TRUE; ROLLBACK; - RETURN; END IF; RETURN; END $$; diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c b/src/exchangedb/pg_batch2_reserves_in_insert.c index 62811f59b..2b5c62f5e 100644 --- a/src/exchangedb/pg_batch2_reserves_in_insert.c +++ b/src/exchangedb/pg_batch2_reserves_in_insert.c @@ -69,7 +69,7 @@ insert1(struct PostgresClosure *pg, PREPARE (pg, "batch1_reserve_create", "SELECT " - "out_reserve_found AS conflicted" + " out_reserve_found AS conflicted" ",transaction_duplicate" ",ruuid AS reserve_uuid" " FROM exchange_do_batch_reserves_in_insert" @@ -103,7 +103,6 @@ insert1(struct PostgresClosure *pg, TALER_payto_hash (reserves[0].sender_account_details, &h_payto); - /* Note: query uses 'on conflict do nothing' */ qs2 = GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "batch1_reserve_create", params, @@ -168,7 +167,7 @@ insert2 (struct PostgresClosure *pg, GNUNET_PQ_query_param_auto_from_type (&h_payto), GNUNET_PQ_query_param_string (reserves[0].sender_account_details), GNUNET_PQ_query_param_timestamp (&reserve_expiration), - GNUNET_PQ_query_param_string (notify_s[0]), // FIXME: 2 different notifies! + GNUNET_PQ_query_param_string (notify_s[0]), GNUNET_PQ_query_param_string (notify_s[1]), GNUNET_PQ_query_param_auto_from_type (reserves[1].reserve_pub), @@ -210,7 +209,7 @@ insert2 (struct PostgresClosure *pg, if (qs1 < 0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Failed to create reserves (%d)\n", + "Failed to create reserves 2(%d)\n", qs1); results[0]=qs1; return qs1; @@ -227,7 +226,7 @@ insert2 (struct PostgresClosure *pg, ) { GNUNET_break (0); - TEH_PG_rollback (pg); + TEH_PG_rollback (pg); //ROLLBACK results[0] = GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_DB_STATUS_HARD_ERROR; } @@ -691,7 +690,6 @@ TEH_PG_batch2_reserves_in_insert (void *cls, reserves_length - i); if (bs >= 8) { - // fprintf(stdout, "batch8"); qs1=insert8(pg, &reserves[i], expiry, @@ -707,7 +705,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls, if (qs1<0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Failed to update reserves8 (%d)\n", + "Failed to update reserves 8 (%d)\n", qs1); return qs1; }