aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_get_link_data.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-05 19:11:47 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-05 19:11:47 +0100
commitab03ba16e9bc63eb5384e7b6b590fc029bf61152 (patch)
tree7a77a729c132f2fdb9fce0142b0bf3796e568ea1 /src/exchangedb/pg_get_link_data.c
parente66087987f6c3565594dee3420f53165b85ba4fe (diff)
downloadexchange-ab03ba16e9bc63eb5384e7b6b590fc029bf61152.tar.xz
exchangedb: use partial index instead of materialized tables deposits_by_ready and deposits_by_matching; remove now broken code; rename benchmarks to use perf_-prefix and correspond to function they benchmark
Diffstat (limited to 'src/exchangedb/pg_get_link_data.c')
-rw-r--r--src/exchangedb/pg_get_link_data.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/exchangedb/pg_get_link_data.c b/src/exchangedb/pg_get_link_data.c
index 26225a13d..a07954335 100644
--- a/src/exchangedb/pg_get_link_data.c
+++ b/src/exchangedb/pg_get_link_data.c
@@ -55,7 +55,7 @@ struct LinkDataContext
/**
* Status, set to #GNUNET_SYSERR on errors,
*/
- int status;
+ enum GNUNET_GenericReturnValue status;
};
@@ -190,20 +190,18 @@ TEH_PG_get_link_data (void *cls,
"%d%c",
&percent_refund,
&dummy)) )
- {
- if (NULL != mode)
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Bad mode `%s' specified\n",
- mode);
- }
- if (NULL==mode)
- percent_refund=0;
+ {
+ if (NULL != mode)
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Bad mode `%s' specified\n",
+ mode);
+ percent_refund = 0;
+ }
}
-
switch (percent_refund)
{
case 0:
- query="get_link";
+ query = "get_link";
PREPARE (pg,
query,
"SELECT "
@@ -225,7 +223,7 @@ TEH_PG_get_link_data (void *cls,
" ORDER BY tp.transfer_pub, rrc.freshcoin_index ASC");
break;
case 1:
- query="get_link_v1";
+ query = "get_link_v1";
PREPARE (pg,
query,
"WITH rc AS MATERIALIZED ("
@@ -252,7 +250,7 @@ TEH_PG_get_link_data (void *cls,
" ORDER BY tp.transfer_pub, rrc.freshcoin_index ASC");
break;
case 2:
- query="get_link_v2";
+ query = "get_link_v2";
PREPARE (pg,
query,
"SELECT"
@@ -300,5 +298,3 @@ TEH_PG_get_link_data (void *cls,
return GNUNET_DB_STATUS_HARD_ERROR;
return qs;
}
-
-