Summary:ASTERISK-26172: res_sorcery_realtime: fix bug when successful sql UPDATE is treated as failed if there is no affected rows.
Reporter:Alexei Gradinari (alexei gradinari)Labels:
Date Opened:2016-07-04 16:39:03Date Closed:2016-09-01 11:19:04
Status:Closed/CompleteComponents:Core/Sorcery Resources/res_config_odbc Resources/res_realtime
Versions:13.9.1 Frequency of
Description:If the SQL UPDATE statement changes nothing then SQLRowCount returns 0.
This value should be treated as success.
But the function sorcery_realtime_update treats it as failed.

This bug was found using stress tests on PJSIP.
If there are 2 consecutive SIP REGISTER requests with the same contact data  during 1 second then res_pjsip_registrar adds contact location on 1st request and tries to update contact location on 2nd.
The update fails (because of this bug) and res_pjsip_registrar even removes correct contact location.

Comments:By: Asterisk Team (asteriskteam) 2016-07-04 16:39:04.102-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].