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

Alex Hermann alex at speakup.nl
Sat Feb 7 01:06:47 CET 2009


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.

> 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?!?



More information about the Devel mailing list