summaryrefslogtreecommitdiff
path: root/src/backenddb/plugin_merchantdb_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 7c4b543a..f8f8e69d 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -1008,7 +1008,7 @@ postgres_lock_product (void *cls,
const char *instance_id,
const char *product_id,
const struct GNUNET_Uuid *uuid,
- uint32_t quantity,
+ uint64_t quantity,
struct GNUNET_TIME_Absolute expiration_time)
{
struct PostgresClosure *pg = cls;
@@ -1016,7 +1016,7 @@ postgres_lock_product (void *cls,
GNUNET_PQ_query_param_string (instance_id),
GNUNET_PQ_query_param_string (product_id),
GNUNET_PQ_query_param_auto_from_type (uuid),
- GNUNET_PQ_query_param_uint32 (&quantity),
+ GNUNET_PQ_query_param_uint64 (&quantity),
GNUNET_PQ_query_param_absolute_time (&expiration_time),
GNUNET_PQ_query_param_end
};
@@ -5885,10 +5885,10 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
" JOIN ps USING (product_serial)"
" WHERE "
" total_stock - total_sold - total_lost - $4 >= "
- " (SELECT SUM(total_locked)"
+ " (SELECT COALESCE(SUM(total_locked), 0)"
" FROM merchant_inventory_locks"
" WHERE product_serial=ps.product_serial) + "
- " (SELECT SUM(total_locked)"
+ " (SELECT COALESCE(SUM(total_locked), 0)"
" FROM merchant_order_locks"
" WHERE product_serial=ps.product_serial)",
5),