[SR-Users] Negative value returned when using sql_pvquery

Daniel Tryba d.tryba at pocos.nl
Wed Jan 6 12:04:47 CET 2016

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

More information about the sr-users mailing list