diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-30 16:14:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-30 16:14:41 +0100 |
commit | f80d6d695a76113ce5537592539bf38c35367fd7 (patch) | |
tree | 6a5922ffdff70e2e27458d294a413d444dfa3d1e /src | |
parent | 5954e6f7965d1575b9acde2492801f5c69f92dfc (diff) | |
download | gnunet-f80d6d695a76113ce5537592539bf38c35367fd7.tar.gz gnunet-f80d6d695a76113ce5537592539bf38c35367fd7.zip |
ignore prepared statement failures if statement is already known to enable connection pooling
Diffstat (limited to 'src')
-rw-r--r-- | src/pq/pq_prepare.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pq/pq_prepare.c b/src/pq/pq_prepare.c index 76fc5c374..fcf1cc793 100644 --- a/src/pq/pq_prepare.c +++ b/src/pq/pq_prepare.c | |||
@@ -106,12 +106,22 @@ GNUNET_PQ_prepare_statements (struct GNUNET_PQ_Context *db, | |||
106 | { | 106 | { |
107 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | 107 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
108 | "pq", | 108 | "pq", |
109 | _ ("PQprepare (`%s' as `%s') failed with error: %s\n"), | 109 | "PQprepare (`%s' as `%s') failed with error: %s\n", |
110 | ps[i].sql, | 110 | ps[i].sql, |
111 | ps[i].name, | 111 | ps[i].name, |
112 | PQerrorMessage (db->conn)); | 112 | PQerrorMessage (db->conn)); |
113 | PQclear (ret); | 113 | PQclear (ret); |
114 | return GNUNET_SYSERR; | 114 | ret = PQdescribePrepared (db->conn, |
115 | ps[i].name); | ||
116 | if (PGRES_COMMAND_OK != PQresultStatus (ret)) | ||
117 | { | ||
118 | PQclear (ret); | ||
119 | return GNUNET_SYSERR; | ||
120 | } | ||
121 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | ||
122 | "pq", | ||
123 | "Statement `%s' already known. Ignoring the issue in the hope that you are using connection pooling...\n", | ||
124 | ps[i].name); | ||
115 | } | 125 | } |
116 | PQclear (ret); | 126 | PQclear (ret); |
117 | } | 127 | } |