[SR-Users] Negative value returned when using sql_pvquery

Jonathan Hunter hunterj91 at hotmail.com
Wed Jan 6 13:13:42 CET 2016


Hi Both,
Thank you both for the explanations.
The cast addition to the query works perfectly!
thanks very much.
Jon

> Date: Wed, 6 Jan 2016 12:04:47 +0100
> From: d.tryba at pocos.nl
> To: sr-users at lists.sip-router.org
> Subject: Re: [SR-Users] Negative value returned when using sql_pvquery
> 
> On Wed, Jan 06, 2016 at 10:48:38AM +0000, Jonathan Hunter wrote:
> > Currently the field I am extracting the value from in the database is set to type;
> > bigint(20) unsigned   
> > If I change to varchar for example it returns fine, my only issue is that the overflow only occurs on 10 digit numbers starting with 2 or 3.
> > If I add a value for example 1785702370 or 7785702370 they are returned without issue without changing the DB value type.
> 
> The problem you experience occurs for all numbers >= 2147483648 (2^31)
> and <= 4294967296 (2^32). Looks like the auto conversion in kamailio is
> doing funky stuff in this range :) Can you verify this? 
> 
> BTW You don't have to change the table, you can do (im|ex)plicit casts
> in the query in kamailio. See
> https://dev.mysql.com/doc/refman/5.5/en/type-conversion.html for
> example.
> 
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160106/aba01ee8/attachment.html>


More information about the sr-users mailing list