mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@275626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -526,6 +526,13 @@ static int config_module(int reload)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rows = PQntuples(result);
|
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++) {
|
for (i = 0; i < rows; i++) {
|
||||||
fname = PQgetvalue(result, i, 0);
|
fname = PQgetvalue(result, i, 0);
|
||||||
ftype = PQgetvalue(result, i, 1);
|
ftype = PQgetvalue(result, i, 1);
|
||||||
|
Reference in New Issue
Block a user