From aa8eb582bd62448362a0146cc4de2fba40d92374 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 30 Mar 2010 22:09:55 +0200 Subject: [PATCH] postgresql plugin: Let the read callback fail if all queries failed. --- src/postgresql.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/postgresql.c b/src/postgresql.c index 99e40fec..d390abdf 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -463,6 +463,8 @@ static int c_psql_exec_query (c_psql_database_t *db, udb_query_t *q, static int c_psql_read (user_data_t *ud) { c_psql_database_t *db; + + int success = 0; int i; if ((ud == NULL) || (ud->data == NULL)) { @@ -489,8 +491,12 @@ static int c_psql_read (user_data_t *ud) && (udb_query_check_version (q, db->server_version) <= 0)) continue; - c_psql_exec_query (db, q, prep_area); + if (0 == c_psql_exec_query (db, q, prep_area)) + success = 1; } + + if (! success) + return -1; return 0; } /* c_psql_read */ -- 2.11.0