[Home]

Summary:ASTERISK-16218: [patch] cdr_pgsql does not detect when a table is not found
Reporter:Mark Murawski (kobaz)Labels:
Date Opened:2010-06-06 15:48:34Date Closed:2010-07-12 10:38:11
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cdr_pgsql.patch
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
Comments:By: Leif Madsen (lmadsen) 2010-06-09 10:14:06

Thanks for the patch! This looks like a welcome addition.

By: Leif Madsen (lmadsen) 2010-07-09 14:19:04

I'm going to commit this.

By: Mark Murawski (kobaz) 2010-07-09 14:29:53

sounds good

By: Digium Subversion (svnbot) 2010-07-12 10:37:00

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 ASTERISK-16218)
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

By: Digium Subversion (svnbot) 2010-07-12 10:38:10

Repository: asterisk
Revision: 275627

_U  branches/1.6.2/
U   branches/1.6.2/cdr/cdr_pgsql.c

------------------------------------------------------------------------
r275627 | lmadsen | 2010-07-12 10:38:10 -0500 (Mon, 12 Jul 2010) | 19 lines

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 ASTERISK-16218)
 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=275627