[asterisk-dev] NULL from MySQL database not NULL?

Atis Lezdins atis at iq-labs.net
Thu May 7 10:21:54 CDT 2009


On Thu, May 7, 2009 at 8:21 AM, Chris Maciejewski <chris at wima.co.uk> wrote:
> I understand ISNULL function has no relation to a database.
> And ISNULL function is working perfectly fine.
>
> There is a problem with MYSQL( fetch.... ) which converts NULL into "NULL".
> I opened a bug 15045 and submitted a patch to fix this.
>

The problem is that there is no distinction within Asterisk variables
between empty and NULL. So, Your patch would just return empty string
which could be perfectly valid string response (not NULL). I believe
that it's more uncommon to have actual data in MySQL to contain string
"NULL" than empty string, so it seems a good choice. Changes in this
could break some dialplans, which would lead to unsatisfied users.

The total solution of course would be to have distinction in Asterisk
between string not set and empty string.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list