<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Both,<div><br></div><div>Thank you both for the explanations.</div><div><br></div><div>The cast addition to the query works perfectly!</div><div><br></div><div>thanks very much.</div><div><br></div><div>Jon<br><br><div>> Date: Wed, 6 Jan 2016 12:04:47 +0100<br>> From: d.tryba@pocos.nl<br>> To: sr-users@lists.sip-router.org<br>> Subject: Re: [SR-Users] Negative value returned when using sql_pvquery<br>> <br>> On Wed, Jan 06, 2016 at 10:48:38AM +0000, Jonathan Hunter wrote:<br>> > Currently the field I am extracting the value from in the database is set to type;<br>> > bigint(20) unsigned   <br>> > 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.<br>> > If I add a value for example 1785702370 or 7785702370 they are returned without issue without changing the DB value type.<br>> <br>> The problem you experience occurs for all numbers >= 2147483648 (2^31)<br>> and <= 4294967296 (2^32). Looks like the auto conversion in kamailio is<br>> doing funky stuff in this range :) Can you verify this? <br>> <br>> BTW You don't have to change the table, you can do (im|ex)plicit casts<br>> in the query in kamailio. See<br>> https://dev.mysql.com/doc/refman/5.5/en/type-conversion.html for<br>> example.<br>> <br>> <br>> _______________________________________________<br>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>> sr-users@lists.sip-router.org<br>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></div></div>                                      </div></body>
</html>