aboutsummaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-22 21:47:42 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-22 21:47:42 +0200
commit8703a0516f92819ea97d991984540332c061fe17 (patch)
tree338da09bb4f4f3f280e2ed7cbcc8698b9cb870de /src/pq
parent422e7a0319bbb6e8ae87d5d37ed5674b4daf1bcb (diff)
downloadgnunet-8703a0516f92819ea97d991984540332c061fe17.tar.gz
gnunet-8703a0516f92819ea97d991984540332c061fe17.zip
ensure psql fails hard if there is an error in the SQL (fixes #6437)
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/pq_connect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index e3a610922..881a158bb 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -172,6 +172,8 @@ apply_patch (struct GNUNET_PQ_Context *db,
172 "-f", 172 "-f",
173 buf, 173 buf,
174 "-q", 174 "-q",
175 "--set",
176 "ON_ERROR_STOP=1",
175 NULL); 177 NULL);
176 if (NULL == psql) 178 if (NULL == psql)
177 { 179 {
@@ -415,7 +417,7 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
415 db->load_path)) 417 db->load_path))
416 { 418 {
417 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 419 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
418 "Failed to load SQL statements from `%s'\n", 420 "Failed to load SQL statements from `%s*'\n",
419 db->load_path); 421 db->load_path);
420 PQfinish (db->conn); 422 PQfinish (db->conn);
421 db->conn = NULL; 423 db->conn = NULL;