[sr-dev] [tracker] Task opened: SQLOPS returns 0 for empty result set instead of $null

sip-router bugtracker at sip-router.org
Fri Dec 6 10:59:45 CET 2013


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.



More information about the sr-dev mailing list