aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-25 17:05:09 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-25 17:05:22 +0200
commit169f1c8c1db0a6d8cebf308ced1de064eadcdc4d (patch)
tree27b86aa84b65360df50a91c5ada878f590700a7d /src
parent2c6b87e1974c502a2fc074050c41daa4674dbdc0 (diff)
downloadgnunet-169f1c8c1db0a6d8cebf308ced1de064eadcdc4d.tar.gz
gnunet-169f1c8c1db0a6d8cebf308ced1de064eadcdc4d.zip
allow NULL fields for varsize
Diffstat (limited to 'src')
-rw-r--r--src/datacache/plugin_datacache_postgres.c10
-rw-r--r--src/pq/pq_result_helper.c4
-rw-r--r--src/psycstore/plugin_psycstore_postgres.c12
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)
68{ 68{
69 struct GNUNET_PQ_ExecuteStatement es[] = { 69 struct GNUNET_PQ_ExecuteStatement es[] = {
70 GNUNET_PQ_make_execute ("CREATE TEMPORARY TABLE IF NOT EXISTS gn090dc (" 70 GNUNET_PQ_make_execute ("CREATE TEMPORARY TABLE IF NOT EXISTS gn090dc ("
71 " type INTEGER NOT NULL DEFAULT 0," 71 " type INTEGER NOT NULL,"
72 " discard_time BIGINT NOT NULL DEFAULT 0," 72 " discard_time BIGINT NOT NULL,"
73 " key BYTEA NOT NULL DEFAULT ''," 73 " key BYTEA NOT NULL,"
74 " value BYTEA NOT NULL DEFAULT ''," 74 " value BYTEA NOT NULL,"
75 " path BYTEA DEFAULT '')" 75 " path BYTEA DEFAULT NULL)"
76 "WITH OIDS"), 76 "WITH OIDS"),
77 GNUNET_PQ_make_try_execute ("CREATE INDEX IF NOT EXISTS idx_key ON gn090dc (key)"), 77 GNUNET_PQ_make_try_execute ("CREATE INDEX IF NOT EXISTS idx_key ON gn090dc (key)"),
78 GNUNET_PQ_make_try_execute ("CREATE INDEX IF NOT EXISTS idx_dt ON gn090dc (discard_time)"), 78 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,
84 row, 84 row,
85 fnum)) 85 fnum))
86 { 86 {
87 GNUNET_break (0); 87 /* Let's allow this for varsize */
88 return GNUNET_SYSERR; 88 return GNUNET_OK;
89 } 89 }
90 /* if a field is null, continue but 90 /* if a field is null, continue but
91 * remember that we now return a different result */ 91 * 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,
514 514
515 GNUNET_assert (TRANSACTION_NONE == plugin->transaction); 515 GNUNET_assert (TRANSACTION_NONE == plugin->transaction);
516 516
517 if (announced_at > INT64_MAX || 517 if ( (announced_at > INT64_MAX) ||
518 effective_since > INT64_MAX || 518 (effective_since > INT64_MAX) ||
519 group_generation > INT64_MAX) 519 (group_generation > INT64_MAX) )
520 { 520 {
521 GNUNET_break (0); 521 GNUNET_break (0);
522 return GNUNET_SYSERR; 522 return GNUNET_SYSERR;
523 } 523 }
524 524
525 if (GNUNET_OK != channel_key_store (plugin, channel_key) 525 if ( (GNUNET_OK !=
526 || GNUNET_OK != slave_key_store (plugin, slave_key)) 526 channel_key_store (plugin, channel_key)) ||
527 (GNUNET_OK !=
528 slave_key_store (plugin, slave_key)) )
527 return GNUNET_SYSERR; 529 return GNUNET_SYSERR;
528 530
529 struct GNUNET_PQ_QueryParam params[] = { 531 struct GNUNET_PQ_QueryParam params[] = {