aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/taler_pq_lib.h2
-rw-r--r--src/pq/db_pq.c4
-rw-r--r--src/pq/pq_helper.c4
-rw-r--r--src/pq/test_pq.c11
4 files changed, 5 insertions, 16 deletions
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h
index 6570cb956..980ca29bf 100644
--- a/src/include/taler_pq_lib.h
+++ b/src/include/taler_pq_lib.h
@@ -179,7 +179,7 @@ TALER_PQ_QUERY_PARAM_RSA_SIGNATURE(const struct GNUNET_CRYPTO_rsa_Signature *x);
* @param x pointer to the query parameter to pass
*/
struct TALER_PQ_QueryParam
-TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME(struct GNUNET_TIME_Absolute x);
+TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME(const struct GNUNET_TIME_Absolute *x);
/**
diff --git a/src/pq/db_pq.c b/src/pq/db_pq.c
index 3b39645a7..bb18c56a9 100644
--- a/src/pq/db_pq.c
+++ b/src/pq/db_pq.c
@@ -178,8 +178,6 @@ TALER_PQ_exec_prepared (PGconn *db_conn,
at_nbo = GNUNET_new (struct GNUNET_TIME_AbsoluteNBO);
scratch[soff++] = at_nbo;
- /* FIXME: this does not work for 'forever' as PQ uses 63-bit integers;
- should check and handle! (Need testcase!) */
*at_nbo = GNUNET_TIME_absolute_hton (*at_hbo);
param_values[off] = (void *) at_nbo;
param_lengths[off] = sizeof (struct GNUNET_TIME_AbsoluteNBO);
@@ -537,8 +535,6 @@ TALER_PQ_extract_result (PGresult *result,
PQgetvalue (result,
row,
fnum);
- /* FIXME: this does not work for 'forever' as PQ uses 63-bit integers;
- should check and handle! (Need testcase!) */
*dst = GNUNET_TIME_absolute_ntoh (*res);
break;
}
diff --git a/src/pq/pq_helper.c b/src/pq/pq_helper.c
index 9cbdc54b7..98c02de73 100644
--- a/src/pq/pq_helper.c
+++ b/src/pq/pq_helper.c
@@ -99,10 +99,10 @@ TALER_PQ_QUERY_PARAM_RSA_SIGNATURE (const struct GNUNET_CRYPTO_rsa_Signature *x)
* @return array entry for the query parameters to use
*/
struct TALER_PQ_QueryParam
-TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (struct GNUNET_TIME_Absolute x)
+TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (const struct GNUNET_TIME_Absolute *x)
{
struct TALER_PQ_QueryParam res =
- { TALER_PQ_QF_TIME_ABSOLUTE, &(x), sizeof (x) };
+ { TALER_PQ_QF_TIME_ABSOLUTE, x, sizeof (*x) };
return res;
}
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
index 7146281ed..d34171110 100644
--- a/src/pq/test_pq.c
+++ b/src/pq/test_pq.c
@@ -129,8 +129,8 @@ run_queries (PGconn *conn)
struct TALER_PQ_QueryParam params_insert[] = {
TALER_PQ_QUERY_PARAM_RSA_PUBLIC_KEY (pub),
TALER_PQ_QUERY_PARAM_RSA_SIGNATURE (sig),
- TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (abs_time),
- TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (forever),
+ TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (&abs_time),
+ TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (&forever),
TALER_PQ_QUERY_PARAM_PTR (&hc),
TALER_PQ_QUERY_PARAM_AMOUNT (&hamount),
TALER_PQ_QUERY_PARAM_AMOUNT_NBO (&namount),
@@ -150,8 +150,6 @@ run_queries (PGconn *conn)
TALER_PQ_RESULT_SPEC_END
};
- fprintf (stderr,
- "Inserting\n");
result = TALER_PQ_exec_prepared (conn,
"test_insert",
params_insert);
@@ -168,8 +166,6 @@ run_queries (PGconn *conn)
}
PQclear (result);
- fprintf (stderr,
- "Selecting\n");
result = TALER_PQ_exec_prepared (conn,
"test_select",
params_select);
@@ -187,8 +183,6 @@ run_queries (PGconn *conn)
results_select,
0);
GNUNET_break (GNUNET_YES == ret);
- fprintf (stderr,
- "Verifying\n");
GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
GNUNET_break (0 ==
@@ -233,7 +227,6 @@ main(int argc,
PGresult *result;
int ret;
- // FIXME: pass valid connect string for tests...
GNUNET_log_setup ("test-pq",
"WARNING",
NULL);