[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 02/02: allow NULL fields for varsize
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 02/02: allow NULL fields for varsize |
Date: |
Sun, 25 Jun 2017 17:05:29 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 169f1c8c1db0a6d8cebf308ced1de064eadcdc4d
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jun 25 17:05:09 2017 +0200
allow NULL fields for varsize
---
src/datacache/plugin_datacache_postgres.c | 10 +++++-----
src/pq/pq_result_helper.c | 4 ++--
src/psycstore/plugin_psycstore_postgres.c | 12 +++++++-----
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/datacache/plugin_datacache_postgres.c
b/src/datacache/plugin_datacache_postgres.c
index 5c497cdf8..2fe6498a5 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -68,11 +68,11 @@ init_connection (struct Plugin *plugin)
{
struct GNUNET_PQ_ExecuteStatement es[] = {
GNUNET_PQ_make_execute ("CREATE TEMPORARY TABLE IF NOT EXISTS gn090dc ("
- " type INTEGER NOT NULL DEFAULT 0,"
- " discard_time BIGINT NOT NULL DEFAULT 0,"
- " key BYTEA NOT NULL DEFAULT '',"
- " value BYTEA NOT NULL DEFAULT '',"
- " path BYTEA DEFAULT '')"
+ " type INTEGER NOT NULL,"
+ " discard_time BIGINT NOT NULL,"
+ " key BYTEA NOT NULL,"
+ " value BYTEA NOT NULL,"
+ " path BYTEA DEFAULT NULL)"
"WITH OIDS"),
GNUNET_PQ_make_try_execute ("CREATE INDEX IF NOT EXISTS idx_key ON gn090dc
(key)"),
GNUNET_PQ_make_try_execute ("CREATE INDEX IF NOT EXISTS idx_dt ON gn090dc
(discard_time)"),
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
index d212ab1b8..045fe74b1 100644
--- a/src/pq/pq_result_helper.c
+++ b/src/pq/pq_result_helper.c
@@ -84,8 +84,8 @@ extract_varsize_blob (void *cls,
row,
fnum))
{
- GNUNET_break (0);
- return GNUNET_SYSERR;
+ /* Let's allow this for varsize */
+ return GNUNET_OK;
}
/* if a field is null, continue but
* remember that we now return a different result */
diff --git a/src/psycstore/plugin_psycstore_postgres.c
b/src/psycstore/plugin_psycstore_postgres.c
index 5bf0ba706..046daf6ea 100644
--- a/src/psycstore/plugin_psycstore_postgres.c
+++ b/src/psycstore/plugin_psycstore_postgres.c
@@ -514,16 +514,18 @@ postgres_membership_store (void *cls,
GNUNET_assert (TRANSACTION_NONE == plugin->transaction);
- if (announced_at > INT64_MAX ||
- effective_since > INT64_MAX ||
- group_generation > INT64_MAX)
+ if ( (announced_at > INT64_MAX) ||
+ (effective_since > INT64_MAX) ||
+ (group_generation > INT64_MAX) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if (GNUNET_OK != channel_key_store (plugin, channel_key)
- || GNUNET_OK != slave_key_store (plugin, slave_key))
+ if ( (GNUNET_OK !=
+ channel_key_store (plugin, channel_key)) ||
+ (GNUNET_OK !=
+ slave_key_store (plugin, slave_key)) )
return GNUNET_SYSERR;
struct GNUNET_PQ_QueryParam params[] = {
--
To stop receiving notification emails like this one, please contact
address@hidden