[asterisk-commits] lmadsen: branch 1.6.2 r275627 - in /branches/1.6.2: ./ cdr/cdr_pgsql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 12 10:38:15 CDT 2010


Author: lmadsen
Date: Mon Jul 12 10:38:11 2010
New Revision: 275627

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275627
Log:
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
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/cdr/cdr_pgsql.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/cdr/cdr_pgsql.c?view=diff&rev=275627&r1=275626&r2=275627
==============================================================================
--- branches/1.6.2/cdr/cdr_pgsql.c (original)
+++ branches/1.6.2/cdr/cdr_pgsql.c Mon Jul 12 10:38:11 2010
@@ -529,6 +529,13 @@
 		}
 
 		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);




More information about the asterisk-commits mailing list