[asterisk-bugs] [Asterisk 0018525]: [patch] ast_update2_realtime fails to update multiple columns with MySQL driver

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Dec 24 17:59:25 UTC 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18525 
====================================================================== 
Reported By:                makoto
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   18525
Category:                   Addons/res_config_mysql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           Addons-1.6.2.1 
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:             2010-12-24 02:10 CST
Last Modified:              2010-12-24 11:59 CST
====================================================================== 
Summary:                    [patch] ast_update2_realtime fails to update
multiple columns with MySQL driver
Description: 
For example, the following code fails with MySQL driver.

  ast_update2_realtime("table", "id", "1234", SENTINEL, "foo", "yes",
"bar", "no", SENTINEL);


This doesn't happens when updating single column.

update2_mysql function in res_config_mysql.c generates an incorrect
SQL sentence when updating multiple columns because variable first
is not cleared in the second while loop.

Attached patch will fix the problem.

PostgreSQL driver seems to have the same problem.

====================================================================== 

---------------------------------------------------------------------- 
 (0129951) svnbot (reporter) - 2010-12-24 11:59
 https://issues.asterisk.org/view.php?id=18525#c129951 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 299584

_U  trunk/
U   trunk/addons/res_config_mysql.c

------------------------------------------------------------------------
r299584 | tilghman | 2010-12-24 11:59:24 -0600 (Fri, 24 Dec 2010) | 14
lines

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

........
  r299583 | tilghman | 2010-12-24 11:58:30 -0600 (Fri, 24 Dec 2010) | 7
lines
  
  Reset 'first' variable after usage.
  
  (closes issue https://issues.asterisk.org/view.php?id=18525)
   Reported by: makoto
   Patches: 
         res-config-mysql-update2.patch uploaded by makoto (license 38)
........

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-24 11:59 svnbot         Checkin                                      
2010-12-24 11:59 svnbot         Note Added: 0129951                          
======================================================================




More information about the asterisk-bugs mailing list