summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58aa55e)
raw | patch | inline | side by side (parent: 58aa55e)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 8 Mar 2012 21:07:23 +0000 (22:07 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 28 Jan 2013 21:10:06 +0000 (22:10 +0100) |
Else, we would unnecessarily skip one iteration even when being able to
reconnect right away.
reconnect right away.
src/postgresql.c | patch | blob | history |
diff --git a/src/postgresql.c b/src/postgresql.c
index e3a66743464e46b917fe8e25c760c650a0037e27..0a646391fcc7acf8affe444bb50387926184ffd3 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
if (PGRES_TUPLES_OK != PQresultStatus (res)) {
pthread_mutex_lock (&db->db_lock);
+ if ((CONNECTION_OK != PQstatus (db->conn))
+ && (0 == c_psql_check_connection (db))) {
+ PQclear (res);
+ return c_psql_exec_query (db, q, prep_area);
+ }
+
log_err ("Failed to execute SQL query: %s",
PQerrorMessage (db->conn));
log_info ("SQL query was: %s",