gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (2d440f03a -> 169f1c8c1)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (2d440f03a -> 169f1c8c1)
Date: Sun, 25 Jun 2017 17:05:27 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from 2d440f03a Fix debug message.
     new 2c6b87e19 start to fix some test issues with postgres psycstore
     new 169f1c8c1 allow NULL fields for varsize

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/datacache/plugin_datacache_postgres.c | 10 +++++-----
 src/pq/pq_result_helper.c                 |  4 ++--
 src/psycstore/plugin_psycstore_postgres.c | 29 +++++++++++++++++------------
 3 files changed, 24 insertions(+), 19 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 b8010af0a..046daf6ea 100644
--- a/src/psycstore/plugin_psycstore_postgres.c
+++ b/src/psycstore/plugin_psycstore_postgres.c
@@ -465,8 +465,10 @@ channel_key_store (struct Plugin *plugin,
     GNUNET_PQ_query_param_end
   };
 
-  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
-      GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_channel_key", 
params))
+  if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
+      GNUNET_PQ_eval_prepared_non_select (plugin->dbh,
+                                         "insert_channel_key",
+                                         params))
     return GNUNET_SYSERR;
 
   return GNUNET_OK;
@@ -482,7 +484,7 @@ slave_key_store (struct Plugin *plugin,
     GNUNET_PQ_query_param_end
   };
 
-  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
+  if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
       GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_slave_key", 
params))
     return GNUNET_SYSERR;
 
@@ -508,21 +510,22 @@ postgres_membership_store (void *cls,
                            uint64_t group_generation)
 {
   struct Plugin *plugin = cls;
-
-  uint32_t idid_join = (uint32_t)did_join;
+  uint32_t idid_join = (uint32_t) did_join;
 
   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[] = {
@@ -535,8 +538,10 @@ postgres_membership_store (void *cls,
     GNUNET_PQ_query_param_end
   };
 
-  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
-      GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_membership", 
params))
+  if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
+      GNUNET_PQ_eval_prepared_non_select (plugin->dbh,
+                                         "insert_membership",
+                                         params))
     return GNUNET_SYSERR;
 
   return GNUNET_OK;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]