[Asterisk-code-review] res sorcery realtime: fix bug when successful UPDATE is trea... (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Thu Jul 7 09:04:13 CDT 2016


Hello Anonymous Coward #1000019, Joshua Colp,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/3146

to look at the new patch set (#2).

Change subject: res_sorcery_realtime: fix bug when successful UPDATE is treated as failed
......................................................................

res_sorcery_realtime: fix bug when successful UPDATE is treated as failed

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 and res_pjsip_registrar even removes correct contact location.

The test "object_update_uncreated" was removed from test_sorcery_realtime.c
because it's now a valid situation.

This patch also adds missing debug of extra SQL parameter.

ASTERISK-26172 #close

Change-Id: I05a7f3051455336c9dda29efc229decf86071303
---
M res/res_config_odbc.c
M res/res_sorcery_realtime.c
M tests/test_sorcery_realtime.c
3 files changed, 2 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/3146/2
-- 
To view, visit https://gerrit.asterisk.org/3146
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I05a7f3051455336c9dda29efc229decf86071303
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list