<div dir="ltr">The patch appears to be working as intended with regards to storing and later using the decimal value as a string:<div><br></div><div>Mar 10 09:50:15 localhost /usr/sbin/opensips[27541]: DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x7f8ecd2b5d68)[14]=[delay]<br>Mar 10 09:50:15 localhost /usr/sbin/opensips[27541]: DBG:db_mysql:db_mysql_get_columns: use DB_DOUBLE result type<br><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Mar 10 09:50:15 localhost /usr/sbin/opensips[27541]: DBG:db_mysql:db_mysql_str2val: converting DOUBLE [0.0019]<br></div><div dir="ltr"><br></div><div>However, when printed it appears as "0.001900". If that his how thing string would be passed to mathops, etc., it would cause problems for anyone interested in significant digits. E.g this could affect the precision of billing calculations. At this point, I'm just happy the Error and Warning are gone and the value is useful at all, but if someone wanted to take this a step further, they could get the precision of the value from the SQL data. Here's an example MySQL data packet with "Decimals: 4":<br><br></div><div><font face="monospace">MySQL Protocol<br> Packet Length: 27<br> Packet Number: 16<br> Catalog: def<br> Database: <br> Table: <br> Original table: <br> Name: delay<br> Original name: <br> Charset number: binary COLLATE binary (63)<br> Length: 26<br> Type: FIELD_TYPE_NEWDECIMAL (246)<br> Flags: 0x0080<br> Decimals: 4<br></font></div><div dir="ltr"><br></div><div dir="ltr">Regards,<div><br></div><div><p style="font-family:helvetica,arial,sans-serif;font-size:12px;margin:0px;padding:0px 0px 20px;color:rgb(0,0,0)"><strong>Calvin Ellison</strong><br>Senior Voice Operations Engineer<br><a href="mailto:calvin.ellison@voxox.com" style="text-decoration:none;color:rgb(14,123,174)" target="_blank">calvin.ellison@voxox.com</a><br>+1 (213) 285-0555<br><br>-----------------------------------------------<br><strong><a href="http://www.voxox.com/" style="text-decoration:none;color:rgb(14,123,174)" target="_blank">voxox.com</a> </strong><br>5825 Oberlin Drive, Suite 5<br>San Diego, CA 92121<br></p><img src="http://cdn.voxox.com/img/voxox-logo.png" alt="Voxox" style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 10, 2020 at 9:49 AM Brett Nemeroff <<a href="mailto:brett@nemeroff.com">brett@nemeroff.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">Totally agree that this is the right thing to do. I just wanted the list to know it’s a STRING. I don’t think it’s obvious.</div><div dir="auto"><br></div><div dir="auto">Thanks again!!</div><div dir="auto"><br></div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 10, 2020 at 11:45 AM Liviu Chircu <<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10.03.2020 18:39, Brett Nemeroff wrote:<br>
> This isn’t really a problem unless you are going to math it or push it <br>
> into something else without casting it.<br>
<br>
I agree, but at script level, there is no support for manipulating <br>
"long" integers,<br>
let along "double" precision integers. So casting the "double" number <br>
to a string<br>
within avpops and returning it to the script seemed like a pretty good <br>
workaround.<br>
<br>
Additionally, this doesn't stop you from doing floating point math in <br>
the script using mathops [1]!<br>
<br>
[1]: <a href="https://opensips.org/docs/modules/3.1.x/mathops.html" rel="noreferrer" target="_blank">https://opensips.org/docs/modules/3.1.x/mathops.html</a><br></blockquote></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>