postgresql plugin: Check for and report MinPGVersion > MaxPGVersion.
authorSebastian Harl <sh@tokkee.org>
Tue, 26 Aug 2008 14:15:37 +0000 (16:15 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 26 Aug 2008 17:13:34 +0000 (19:13 +0200)
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/postgresql.c

index b1de07f..409a5de 100644 (file)
@@ -774,6 +774,14 @@ static int c_psql_config_query (oconfig_item_t *ci)
                        log_warn ("Ignoring unknown config key \"%s\".", c->key);
        }
 
+       if (query->min_pg_version > query->max_pg_version) {
+               log_err ("Query \"%s\": MinPGVersion > MaxPGVersion.",
+                               query->name);
+               c_psql_query_delete (query);
+               --queries_num;
+               return 1;
+       }
+
        if (NULL == query->query) {
                log_err ("Query \"%s\" does not include an SQL query string - "
                                "please check your configuration.", query->name);