aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorlmadsen <lmadsen@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-12 15:38:11 +0000
committerlmadsen <lmadsen@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-12 15:38:11 +0000
commite8a21b70a3fc9d15c68f8c77f9e58d523cf07aca (patch)
treeab74ba97a97b8d217e68195f9e8f9bd0dcabd71d /cdr
parent973d5da714d7a1d6f6f96fa909dd4401d69502ac (diff)
Merged revisions 275626 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r275626 | lmadsen | 2010-07-12 10:37:01 -0500 (Mon, 12 Jul 2010) | 11 lines cdr_pgsql does not detect when a table is found. This change adds an ERROR message to let you know when a failure exists to get the columns from the pgsql database, which typically means that the table does not exist. (closes issue #17478) Reported by: kobaz Patches: cdr_pgsql.patch uploaded by kobaz (license 834) Tested by: kobaz, russell, lmadsen ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@275627 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_pgsql.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index bca0f863d..dc9b188cf 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -529,6 +529,13 @@ static int config_module(int reload)
}
rows = PQntuples(result);
+ if (rows == 0) {
+ ast_log(LOG_ERROR, "cdr_pgsql: Failed to query database columns. No columns found, does the table exist?\n");
+ PQclear(result);
+ unload_module();
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
for (i = 0; i < rows; i++) {
fname = PQgetvalue(result, i, 0);
ftype = PQgetvalue(result, i, 1);