[asterisk-bugs] [Asterisk 0016000]: [patch] Schema problem with res_pgsql

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 6 14:44:46 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16000 
====================================================================== 
Reported By:                jamicque
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   16000
Category:                   Resources/res_config_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           1.6.1.6 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-10-01 06:37 CDT
Last Modified:              2009-10-06 14:44 CDT
====================================================================== 
Summary:                    [patch] Schema problem with res_pgsql
Description: 
When you are using reltime with pgsql, asterisk on every connect check the
table and it's columns. 
For example it's made by querry (for meetme):

SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod
FROM pg_class c, pg_type t, pg_attribute a LEFT OUTER JOIN pg_attrdef d ON
a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum WHERE c.oid =
a.attrelid AND a.atttypid = t.oid AND (a.attnum > 0) AND c.relname =
'meetme' ORDER BY c.relname, attnum

The problem is that it does not check the schema. If you have two
different schemas and in every one table meetme, in result Asterisk will
try to insert double statements into one table, which will result in an
error.


======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0016001 schema problem
====================================================================== 

---------------------------------------------------------------------- 
 (0111929) svnbot (reporter) - 2009-10-06 14:44
 https://issues.asterisk.org/view.php?id=16000#c111929 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 222311

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

------------------------------------------------------------------------
r222311 | tilghman | 2009-10-06 14:44:45 -0500 (Tue, 06 Oct 2009) | 17
lines

Merged revisions 222309 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r222309 | tilghman | 2009-10-06 14:31:39 -0500 (Tue, 06 Oct 2009) | 10
lines
  
  Change schema query to involve the use of an optional schema parameter.
  This change is done in such a way as to allow the driver to continue to
  function with older databases which don't have these features.
  (closes issue https://issues.asterisk.org/view.php?id=16000)
   Reported by: jamicque
   Patches: 
         20091002__issue16000.diff.txt uploaded by tilghman (license 14)
         20091002__issue16000__1.6.1.diff.txt uploaded by tilghman
(license 14)
   Tested by: jamicque
........

------------------------------------------------------------------------

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-10-06 14:44 svnbot         Checkin                                      
2009-10-06 14:44 svnbot         Note Added: 0111929                          
======================================================================




More information about the asterisk-bugs mailing list