THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Dmitry Davletbaev (ddomgn)
Attached to Project - sip-router Summary - SQLOPS returns 0 for empty result set instead of $null Task Type - Bug Report Category - Module Status - Unconfirmed Assigned To - Operating System - Linux Severity - Low Priority - Normal Reported Version - Development Due in Version - Undecided Due Date - Undecided Details - **System**: Debian Wheezy
**Kamailio version**: 4.1.0
I use SQLOPS module to query additional data in MySQL database. Script logic is based on user related DB records existence. I check wether records exist or not simply by assigning variable:
$var(touser) = $dbr(touser=>[0,0]); if ($var(touser) != $null) { [...] } else { [...] }
Above code works perfectly in Kamailio 4.0.3 and 4.0.4, but in 4.1.0 a zero is assigned to $var(touser), so I had to change 'if' statement to
if ($var(touser) != 0) {
I consider this behavior as a bug, because "no value" should be represented by $null, not 0. Correct me if I am wrong.
More information can be found at the following URL: http://sip-router.org/tracker/index.php?do=details&task_id=376
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
sip-router writes:
I use SQLOPS module to query additional data in MySQL database. Script logic is based on user related DB records existence. I check wether records exist or not simply by assigning variable:
$var(touser) = $dbr(touser=>[0,0]); if ($var(touser) != $null) { [...] } else { [...] }
perhaps better way to check if any records were returned is to test if $dbr(result=>rows) is greater than 0.
-- juha