[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/08: fix possibility of NULL result for empty da
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/08: fix possibility of NULL result for empty database |
Date: |
Tue, 19 Feb 2019 02:02:06 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 472250336a3732a1afdd7d2f53386a650b812502
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Feb 19 01:51:02 2019 +0100
fix possibility of NULL result for empty database
---
src/datastore/plugin_datastore_postgres.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/datastore/plugin_datastore_postgres.c
b/src/datastore/plugin_datastore_postgres.c
index 94db6e116..0a3018411 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -11,7 +11,7 @@
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -153,7 +153,11 @@ init_connection (struct Plugin *plugin)
"SELECT hash FROM gn090",
0),
GNUNET_PQ_make_prepare ("estimate_size",
- "SELECT SUM(LENGTH(value))+256*COUNT(*) AS total
FROM gn090",
+ "SELECT CASE WHEN NOT EXISTS"
+ " (SELECT 1 FROM gn090)"
+ " THEN 0"
+ " ELSE (SELECT SUM(LENGTH(value))+256*COUNT(*)
FROM gn090)"
+ "END AS total",
0),
GNUNET_PQ_PREPARED_STATEMENT_END
};
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (ff2452d55 -> 2caf34724), gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 03/08: do not use rps in consensus test, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 01/08: extra sanity check for #5582, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 02/08: unset XDG vars in test explicitly in case test is run by hand, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 04/08: fix possibility of NULL result for empty database,
gnunet <=
- [GNUnet-SVN] [gnunet] 06/08: note about assertion actually failing, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 07/08: got integration tests to pass, fixes #5560, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 05/08: do not strictly require mq non-NULL, as peerinfo service might have died already, gnunet, 2019/02/18
- [GNUnet-SVN] [gnunet] 08/08: update ignore file, gnunet, 2019/02/18