[Kamailio-Devel] SF.net SVN: openser:[5284] trunk/modules/avpops/avpops_impl.c

Daniel-Constantin Mierla miconda at gmail.com
Sat Feb 7 17:48:26 CET 2009


Hello Alex,

On 02/07/2009 02:06 AM, Alex Hermann wrote:
> On Monday 01 December 2008, Daniel-Constantin Mierla wrote:
>   
>> On 12/01/08 19:30, Klaus Darilion wrote:
>>     
>>> Further I wonder if this can break existing configs
>>>       
> I finally got around to upgrading my test rig, and as expected it breaks 
> every config i have.
>   
it took a bit of time to test :-) ... I will revert back that change if 
it breaks, there was no other report, probably it is about how each is 
checking the return code.

So leave you scripts untouched few days and should work just fine when 
you will do the upgrade. Probably is wise to do negative return code to 
select between those cases. Would be ok for you to differentiate error 
case and no result by a negative reply code? As I could see, your 
if(avp_db_...) won't break in that case.

Cheers,
Daniel



>   
>> Should not break any config. This was reported to me as bug.
>> was that for some queries that succeeded (e.g., insert) the function
>> returned false, same as in case of an error.
>>     
> That could not have been a bug, as the return value was undocumented.
>
> Just like for the other undocumented functions, one determines the behaviour 
> by experimentation and/or source code inspection. The conclusion for both 
> methods was that return value "false" means: "error during execution or no 
> results from query". The last part: "no results from query" is also 
> perfectly valid for INSERTS.
>
>
>   
>> Now, if the query does not throw error, it returns true, and false if
>> there is an execution error.
>>     
> I agree this makes sense, BUT, a long standing behaviour has been changed 
> dramatically, making existing configs fail in sometimes hardly noticable 
> ways and was IMHO _very_ inappropriate to do so in stable releases 1.3 and 
> 1.4. 
>
>
>
> Alex Hermann, now fixing a few dozen scripts...
>
> ps. 'if (avp_db_query("SELECT 1") != 1) {' throws parse errors, even though 
> assigning the return value of the function to an avp works?!?
>
> _______________________________________________
> Kamailio (OpenSER) - Devel mailing list
> Devel at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/devel
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the Devel mailing list