aboutsummaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-15 13:36:47 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-15 13:36:47 +0100
commit54b3a9e9305bd1edd2529e5d0b95cf6943026fc6 (patch)
tree345b4976b6bdaf37c3ab02fb0267e0b65169fc44 /src/auditordb
parenta3db0d4a8c779609137e048bd6ee7c7e4a34901c (diff)
add required rowid for diagnostics
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c8
-rw-r--r--src/auditordb/test_auditordb.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index 989e54aea..1784fdf5e 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -300,6 +300,7 @@ postgres_create_tables (void *cls)
",expiration_date INT8 NOT NULL"
",last_reserve_in_serial_id INT8 NOT NULL"
",last_reserve_out_serial_id INT8 NOT NULL"
+ ",auditor_reserves_rowid BIGSERIAL"
")");
SQLEXEC_INDEX("CREATE INDEX auditor_reserves_by_reserve_pub "
@@ -645,6 +646,7 @@ postgres_prepare (PGconn *db_conn)
",expiration_date"
",last_reserve_in_serial_id"
",last_reserve_out_serial_id"
+ ",auditor_reserves_rowid"
" FROM auditor_reserves"
" WHERE reserve_pub=$1 AND master_pub=$2;",
2, NULL);
@@ -1656,6 +1658,7 @@ postgres_del_reserve_info (void *cls,
* @param session connection to use
* @param reserve_pub public key of the reserve
* @param master_pub master public key of the exchange
+ * @param[out] rowid which row did we get the information from
* @param[out] reserve_balance amount stored in the reserve
* @param[out] withdraw_fee_balance amount the exchange gained in withdraw fees
* due to withdrawals from this reserve
@@ -1672,6 +1675,7 @@ postgres_get_reserve_info (void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_MasterPublicKeyP *master_pub,
+ uint64_t *rowid,
struct TALER_Amount *reserve_balance,
struct TALER_Amount *withdraw_fee_balance,
struct GNUNET_TIME_Absolute *expiration_date,
@@ -1708,12 +1712,10 @@ postgres_get_reserve_info (void *cls,
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_result_spec_amount ("reserve_balance", reserve_balance),
TALER_PQ_result_spec_amount ("withdraw_fee_balance", withdraw_fee_balance),
-
GNUNET_PQ_result_spec_auto_from_type ("expiration_date", expiration_date),
-
GNUNET_PQ_result_spec_uint64 ("last_reserve_in_serial_id", last_reserve_in_serial_id),
GNUNET_PQ_result_spec_uint64 ("last_reserve_out_serial_id", last_reserve_out_serial_id),
-
+ GNUNET_PQ_result_spec_uint64 ("auditor_reserves_rowid", rowid),
GNUNET_PQ_result_spec_end
};
if (GNUNET_OK !=
diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c
index 5f110865d..95e79bdb3 100644
--- a/src/auditordb/test_auditordb.c
+++ b/src/auditordb/test_auditordb.c
@@ -73,6 +73,7 @@ run (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct TALER_AUDITORDB_Session *session;
+ uint64_t rowid;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"loading database plugin\n");
@@ -303,6 +304,7 @@ run (void *cls)
session,
&reserve_pub,
&master_pub,
+ &rowid,
&reserve_balance2,
&withdraw_fee_balance2,
&date,