[sr-dev] git:master: modules_k/presence Fixed DB Storage Modes
Anca Vamanu
anca.vamanu at 1and1.ro
Mon Feb 20 15:18:27 CET 2012
On 02/20/2012 04:12 PM, Klaus Darilion wrote:
>
> On 20.02.2012 14:47, Anca Vamanu wrote:
>> On 02/20/2012 03:26 PM, Klaus Darilion wrote:
>>> Is the SELECT really necessary? If only UPDATE is done, and UPDATE
>>> returns '0 rows' affected then respond with 412.
>>>
>> If only it were like this :) . I have asked about this behavior long
>> time ago. Unfortunately the DB API of kamailio does not say '0 rows
>> affected' when update is performed. It says only if the update was
>> successful or not. No indication if it has actually found a match or
>> not. And actually I don't see this possibility in the mysql library either:
>>
>> http://dev.mysql.com/doc/refman/5.0/en/mysql-real-query.html
> It should work with:
> http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html
>
> klaus
Right. A great new feature idea - add affected_rows() function in the DB
API and for the backends that have this defined, use it instead of query
before update. Probably there are more modules that could benefit from this.
Anca
More information about the sr-dev
mailing list