[asterisk-bugs] [Asterisk 0010614]: various coding errors causing more trouble than reasonable

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Aug 30 23:47:49 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10614 
====================================================================== 
Reported By:                jontow
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   10614
Category:                   CDR/cdr_odbc
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 81402 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             08-30-2007 20:43 CDT
Last Modified:              08-30-2007 23:47 CDT
====================================================================== 
Summary:                    various coding errors causing more trouble than
reasonable
Description: 
Avoid SQLDisconnect() anywhere but odbc_disconnect() (this means in
odbc_log()).

Get the query prepare functions out of odbc_log(), they don't belong there
and it doesn't work: on failure, it'll never succeed because the connection
is trashed and things are never re-prepared after being allocated.

In all of the file, ODBC_res should be of type SQLRETURN, not a normal
int.

In odbc_do_query(), proper error reporting from the ODBC layer doesn't
hurt either; it doesn't crash the drivers if you don't hard-code sizes that
are way too small per the specs and use the correct SQL* types.

No, I don't have a patch that I can post right now, and no, I don't have a
valid disclaimer these days.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 08-30-07 23:47  
---------------------------------------------------------------------- 
Really, the only way to go with this is to convert the module over to use
res_odbc connection management.  This also removes the single-threadedness
that has characterized this module since it was written.

I would encourage you to look at cdr_adaptive_odbc, as it is far more
flexible.  I daresay cdr_odbc will be replaced with cdr_adaptive_odbc after
the next release cycle. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-30-07 23:47  Corydon76      Note Added: 0069766                          
======================================================================




More information about the asterisk-bugs mailing list