aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-27 16:15:32 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-27 16:15:32 +0200
commit9c9e6dba5c9fa7d179932b8ecec63565d7baabc1 (patch)
treec9fe8cc603bb99d409d8904e048868be85ca6bd4 /src
parent7cbda831aec8525fd7a02ad9495904486f80b1a6 (diff)
downloadmerchant-9c9e6dba5c9fa7d179932b8ecec63565d7baabc1.tar.gz
merchant-9c9e6dba5c9fa7d179932b8ecec63565d7baabc1.tar.bz2
merchant-9c9e6dba5c9fa7d179932b8ecec63565d7baabc1.zip
get rid of select *, remove fixme that is no longer needed
Diffstat (limited to 'src')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c40
-rw-r--r--src/include/taler_merchantdb_plugin.h24
2 files changed, 34 insertions, 30 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 084d0421..3967a18f 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -341,7 +341,17 @@ postgres_initialize (void *cls)
" LIMIT $3",
3),
GNUNET_PQ_make_prepare ("find_refunds_from_contract_terms_hash",
- "SELECT * FROM merchant_refunds"
+ "SELECT"
+ "coin_pub"
+ ",rtransaction_id"
+ ",refund_amount_val"
+ ",refund_amount_frac"
+ ",refund_amount_curr"
+ ",refund_fee_val"
+ ",refund_fee_frac"
+ ",refund_fee_curr"
+ ",reason"
+ " FROM merchant_refunds"
" WHERE merchant_pub=$1"
" AND h_contract_terms=$2",
2),
@@ -899,22 +909,20 @@ find_contracts_cb (void *cls,
*/
static enum GNUNET_DB_QueryStatus
postgres_find_contract_terms_by_date_and_range (void *cls,
- struct GNUNET_TIME_Absolute date,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- unsigned int start,
- unsigned int nrows,
- unsigned int future,
- TALER_MERCHANTDB_ProposalDataCallback cb,
- void *cb_cls)
+ struct GNUNET_TIME_Absolute date,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ uint64_t start,
+ uint64_t nrows,
+ int future,
+ TALER_MERCHANTDB_ProposalDataCallback cb,
+ void *cb_cls)
{
- uint64_t s64 = start;
- uint64_t r64 = nrows;
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_absolute_time (&date),
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
- GNUNET_PQ_query_param_uint64 (&s64),
- GNUNET_PQ_query_param_uint64 (&r64),
+ GNUNET_PQ_query_param_uint64 (&start),
+ GNUNET_PQ_query_param_uint64 (&nrows),
GNUNET_PQ_query_param_end
};
const char *stmt;
@@ -956,16 +964,15 @@ static enum GNUNET_DB_QueryStatus
postgres_find_contract_terms_by_date (void *cls,
struct GNUNET_TIME_Absolute date,
const struct TALER_MerchantPublicKeyP *merchant_pub,
- unsigned int nrows,
+ uint64_t nrows,
TALER_MERCHANTDB_ProposalDataCallback cb,
void *cb_cls)
{
struct PostgresClosure *pg = cls;
- uint64_t r64 = nrows;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_absolute_time (&date),
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
- GNUNET_PQ_query_param_uint64 (&r64),
+ GNUNET_PQ_query_param_uint64 (&nrows),
GNUNET_PQ_query_param_end
};
enum GNUNET_DB_QueryStatus qs;
@@ -1611,9 +1618,6 @@ get_refunds_cb (void *cls,
&rtransaction_id),
TALER_PQ_result_spec_amount ("refund_amount",
&refund_amount),
- /**
- * BUGGY: this column is not in that table.
- */
TALER_PQ_result_spec_amount ("refund_fee",
&refund_fee),
GNUNET_PQ_result_spec_string ("reason",
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 6f926b14..f856fc74 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -254,13 +254,13 @@ struct TALER_MERCHANTDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*find_contract_terms_by_date_and_range) (void *cls,
- struct GNUNET_TIME_Absolute date,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- unsigned int start,
- unsigned int nrows,
- unsigned int future,
- TALER_MERCHANTDB_ProposalDataCallback cb,
- void *cb_cls);
+ struct GNUNET_TIME_Absolute date,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ uint64_t start,
+ uint64_t nrows,
+ int future,
+ TALER_MERCHANTDB_ProposalDataCallback cb,
+ void *cb_cls);
/**
* Lookup for a proposal, respecting the signature used by the
@@ -296,11 +296,11 @@ struct TALER_MERCHANTDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*find_contract_terms_by_date) (void *cls,
- struct GNUNET_TIME_Absolute date,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- unsigned int nrows,
- TALER_MERCHANTDB_ProposalDataCallback cb,
- void *cb_cls);
+ struct GNUNET_TIME_Absolute date,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ uint64_t nrows,
+ TALER_MERCHANTDB_ProposalDataCallback cb,
+ void *cb_cls);
/**