commit 20a5731169278e5a2c87ec181975afd3fbba95b1
parent 8a5af3478c7b347c6e75d881fb8050518f8006ad
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Fri, 24 Mar 2017 13:09:52 +0100
logging, db minor fix
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c
@@ -156,7 +156,7 @@ MH_handler_history (struct TMH_RequestHandler *rh,
if (NULL != str)
{
if ((1 != sscanf (str, "%d", &start)) ||
- start < 0)
+ 0 > start)
{
json_decref (response);
return TMH_RESPONSE_reply_arg_invalid (connection,
@@ -178,8 +178,10 @@ MH_handler_history (struct TMH_RequestHandler *rh,
"delta");
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Querying history back to %s\n",
- GNUNET_STRINGS_absolute_time_to_string (date));
+ "Querying history back to %s, start: %d, delta: %d\n",
+ GNUNET_STRINGS_absolute_time_to_string (date),
+ start,
+ delta);
if (0 > start)
ret = db->find_proposal_data_by_date (db->cls,
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
@@ -322,7 +322,7 @@ postgres_initialize (void *cls)
" WHERE"
" timestamp<$1"
" AND merchant_pub=$2"
- " ORDER BY timestamp DESC, row_id DESC"
+ " ORDER BY row_id DESC, timestamp DESC"
" LIMIT $3",
3);
@@ -337,7 +337,7 @@ postgres_initialize (void *cls)
" timestamp<$1"
" AND merchant_pub=$2"
" AND row_id<$3"
- " ORDER BY timestamp DESC, row_id DESC"
+ " ORDER BY row_id DESC, timestamp DESC"
" LIMIT $4",
4);