aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-10-17 10:24:18 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-10-17 10:24:18 +0200
commit4e380d4937da4d51809d57eb60d4b6f0650483a9 (patch)
tree63e479ceca44f5550359fc8329e4cecf744d47ed
parenta4af8963703abb882b08e75f20ef3e525447551e (diff)
remove select-* logics'
-rw-r--r--src/exchangedb/exchange_do_age_withdraw.sql5
-rw-r--r--src/exchangedb/exchange_do_batch_withdraw.sql6
-rw-r--r--src/exchangedb/exchange_do_recoup_by_reserve.sql9
-rw-r--r--src/exchangedb/exchange_do_reserve_open.sql6
4 files changed, 17 insertions, 9 deletions
diff --git a/src/exchangedb/exchange_do_age_withdraw.sql b/src/exchangedb/exchange_do_age_withdraw.sql
index c696bd807..89a291445 100644
--- a/src/exchangedb/exchange_do_age_withdraw.sql
+++ b/src/exchangedb/exchange_do_age_withdraw.sql
@@ -49,8 +49,9 @@ BEGIN
-- reserves_in by reserve_pub (SELECT)
-- wire_targets by wire_target_h_payto
--- FIXME-Oec: never select-*!
-SELECT *
+SELECT current_balance
+ ,birthday
+ ,gc_date
INTO reserve
FROM exchange.reserves
WHERE reserves.reserve_pub=rpub;
diff --git a/src/exchangedb/exchange_do_batch_withdraw.sql b/src/exchangedb/exchange_do_batch_withdraw.sql
index a27f2348e..a48561a9a 100644
--- a/src/exchangedb/exchange_do_batch_withdraw.sql
+++ b/src/exchangedb/exchange_do_batch_withdraw.sql
@@ -41,8 +41,10 @@ BEGIN
-- reserves_in by reserve_pub (SELECT)
-- wire_targets by wire_target_h_payto
--- FIXME-Oec: do not use select-*!
-SELECT *
+SELECT current_balance
+ ,reserve_uuid
+ ,birthday
+ ,gc_date
INTO reserve
FROM exchange.reserves
WHERE reserves.reserve_pub=rpub;
diff --git a/src/exchangedb/exchange_do_recoup_by_reserve.sql b/src/exchangedb/exchange_do_recoup_by_reserve.sql
index a4a191a4a..016826615 100644
--- a/src/exchangedb/exchange_do_recoup_by_reserve.sql
+++ b/src/exchangedb/exchange_do_recoup_by_reserve.sql
@@ -62,12 +62,17 @@ BEGIN
rc.amount,
rc.recoup_timestamp
FROM (
- SELECT * --FIXME: bad code, we never use '*'!
+ SELECT denom_sig
+ ,denominations_serial
FROM exchange.known_coins
WHERE known_coins.coin_pub = c_pub
) kc
JOIN (
- SELECT * --FIXME: bad code, we never use '*'!
+ SELECT coin_pub
+ ,coin_sig
+ ,coin_blind
+ ,amount
+ ,recoup_timestamp
FROM exchange.recoup
WHERE recoup.coin_pub = c_pub
) rc USING (coin_pub);
diff --git a/src/exchangedb/exchange_do_reserve_open.sql b/src/exchangedb/exchange_do_reserve_open.sql
index 5d36d1af7..f37129e55 100644
--- a/src/exchangedb/exchange_do_reserve_open.sql
+++ b/src/exchangedb/exchange_do_reserve_open.sql
@@ -43,9 +43,9 @@ DECLARE
reserve RECORD;
BEGIN
--- FIXME: do not use SELECT-*
--- FIXME: use SELECT FOR UPDATE?
-SELECT *
+SELECT current_balance
+ ,expiration_time
+ ,purses_allowed
INTO reserve
FROM reserves
WHERE reserve_pub=in_reserve_pub;