[Home]

Summary:ASTERISK-17609: [patch] extra ast_strlen_zero() check in cel_odbc prevents integer eventtype in database
Reporter:Matt Lehner (mlehner)Labels:
Date Opened:2011-03-26 11:49:43Date Closed:2011-03-29 03:33:46
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CEL/General
Versions:1.8.3 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cel_odbc.patch
Description:If you create a database schema with a integer datatype for event_type field, it will always be a zero. I did not look into the history of this code, but the problem is with an extra ast_strlen_zero() check that causes the code for filling in the eventtype to be skipped.

****** ADDITIONAL INFORMATION ******

I removed the if conditional with the ast_strlen_zero() check, but kept braces around the remaining code to silence the compilation warnings/errors that result from variable re-declarations.

There is a ast_strlen_zero() check that happens in the second branch of the remaining if blocks. This accomplishes the role of the removed ast_strlen_zero() check. This code was existing.
Comments:By: Tilghman Lesher (tilghman) 2011-03-28 17:09:50

This change reverts revision 236847, which was reported on the -dev list by Nic Colledge.  You need to address his comments, before this can go forward:
http://lists.digium.com/pipermail/asterisk-dev/2009-December/041362.html

Additionally, your change is better solved by setting a default value on the column.

By: Digium Subversion (svnbot) 2011-03-29 02:08:40

Repository: asterisk
Revision: 311799

U   branches/1.8/cel/cel_odbc.c

------------------------------------------------------------------------
r311799 | tilghman | 2011-03-29 02:08:39 -0500 (Tue, 29 Mar 2011) | 7 lines

Remove extraneous check from integer-type fields.

(closes issue ASTERISK-17609)
Reported by: mlehner

Review: https://reviewboard.asterisk.org/r/1149/

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

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

By: Digium Subversion (svnbot) 2011-03-29 03:33:45

Repository: asterisk
Revision: 311806

_U  trunk/
U   trunk/cel/cel_odbc.c

------------------------------------------------------------------------
r311806 | tilghman | 2011-03-29 03:33:45 -0500 (Tue, 29 Mar 2011) | 14 lines

Merged revisions 311799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r311799 | tilghman | 2011-03-29 02:08:39 -0500 (Tue, 29 Mar 2011) | 7 lines
 
 Remove extraneous check from integer-type fields.
 
 (closes issue ASTERISK-17609)
  Reported by: mlehner
 
 Review: https://reviewboard.asterisk.org/r/1149/
........

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

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