[asterisk-bugs] [Asterisk 0017478]: [patch] cdr_pgsql does not detect when a table is not found

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jul 12 10:37:00 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17478 
====================================================================== 
Reported By:                kobaz
Assigned To:                lmadsen
====================================================================== 
Project:                    Asterisk
Issue ID:                   17478
Category:                   CDR/cdr_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                       SWP-1817 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 268572 
Request Review:              
====================================================================== 
Date Submitted:             2010-06-06 15:48 CDT
Last Modified:              2010-07-12 10:37 CDT
====================================================================== 
Summary:                    [patch] cdr_pgsql does not detect when a table is
not found
Description: 
In 1.6.1/1.6.2/trunk 

With a standard cdr_pgsql config... and having not yet created the table
called cdr..

[global]
hostname=localhost
port=5432
dbname=pbx
password=pass
user=root
table=cdr


We get the following, when trying to insert a cdr record


[Jun  6 16:34:06] ERROR[6723]: cdr_pgsql.c:311 pgsql_log: cdr_pgsql:
Connection may have been lost... attempting to reconnect.
[Jun  6 16:34:06] ERROR[6723]: cdr_pgsql.c:314 pgsql_log: cdr_pgsql:
Connection reestablished.
[Jun  6 16:34:06] ERROR[6723]: cdr_pgsql.c:320 pgsql_log: cdr_pgsql: HARD
ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!
[Jun  6 16:34:06] ERROR[6723]: cdr_pgsql.c:321 pgsql_log: cdr_pgsql:
Reason: ERROR:  syntax error at or near ")"
LINE 1: INSERT INTO cdr ) VALUES )
                                     ^
Patch attached
====================================================================== 

---------------------------------------------------------------------- 
 (0124496) svnbot (reporter) - 2010-07-12 10:37
 https://issues.asterisk.org/view.php?id=17478#c124496 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 275626

U   trunk/cdr/cdr_pgsql.c

------------------------------------------------------------------------
r275626 | lmadsen | 2010-07-12 10:36:59 -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 https://issues.asterisk.org/view.php?id=17478)
Reported by: kobaz
Patches:
      cdr_pgsql.patch uploaded by kobaz (license 834)
Tested by: kobaz, russell, lmadsen
------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=275626 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-12 10:37 svnbot         Checkin                                      
2010-07-12 10:37 svnbot         Note Added: 0124496                          
======================================================================




More information about the asterisk-bugs mailing list