gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] 02/05: get rid of select *, remove fixme t


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 02/05: get rid of select *, remove fixme that is no longer needed
Date: Tue, 27 Jun 2017 16:59:31 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

commit 9c9e6dba5c9fa7d179932b8ecec63565d7baabc1
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jun 27 16:15:32 2017 +0200

    get rid of select *, remove fixme that is no longer needed
---
 src/backenddb/plugin_merchantdb_postgres.c | 40 ++++++++++++++++--------------
 src/include/taler_merchantdb_plugin.h      | 24 +++++++++---------
 2 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 084d042..3967a18 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 6f926b1..f856fc7 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);
 
 
   /**

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]