[Home]

Summary:ASTERISK-03970: [patch] realtime update cli returns incorrect result
Reporter:drmac (drmac)Labels:
Date Opened:2005-04-21 21:53:18Date Closed:2008-01-15 15:32:05.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_realtime_patch.txt
( 1) res_config_mysql_patch.txt
( 2) res_config_odbc_patch.txt
Description:Previously, "realtime update sippeers name 4000 nat yes" would return "Updated Realtime Record." even if no rows were actually updated. (ie: the value 'yes' was already stored.) The same result message would appear even if the query failed.

This patch:
  * modifies res_config_mysql's update_realtime function to return correct result codes. (-1 if error, positive int on success equaling num of rows actually affected)
  * modifies res_config_odbc to do same (I hope im not overstepping my bounds on this one.)
  * modifies app_realtime to display number of rows affected so people can tell that a query was executed successfully but modified 0 rows.

This shouldn't have any affect on normal ARA update operations as this value is never checked anywhere else. In config.c this result value is passed to the callee function and in the case of chan_sip, the value is not checked/verified. (chan_sip.c:1214)

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

Disclaimer on file
mboehm@cytelcom.com
Comments:By: drmac (drmac) 2005-04-21 21:59:38

on a side note, can a bug marshal add a "realtime" category to mantis?

By: Kevin P. Fleming (kpfleming) 2005-04-21 22:39:24

Your patches were whitespace damaged, but I applied them anyway. Thanks!

By: Kevin P. Fleming (kpfleming) 2005-04-21 22:39:50

Not for stable

By: Digium Subversion (svnbot) 2008-01-15 15:32:05.000-0600

Repository: asterisk
Revision: 5496

U   trunk/apps/app_realtime.c
U   trunk/res/res_config_odbc.c

------------------------------------------------------------------------
r5496 | kpfleming | 2008-01-15 15:32:04 -0600 (Tue, 15 Jan 2008) | 2 lines

report the number of rows updated when using RealTime update method (bug ASTERISK-3970)

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

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