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

Chris Maciejewski chris at wima.co.uk
Wed May 6 14:52:44 CDT 2009


Hi Tilghman,

I would argue with this because my "null" value in the database is not
a literal "null" string, but the actual null value. It is a result of
the following query: "UPDATE table SET some_null_col = NULL WHERE id =
1"

So the actual value of some_null_col is NULL and not "NULL" and once
such a value is assigned to a channel variable, that variable is NULL,
therefore ISNULL function should return 1.


2009/5/6 Tilghman Lesher <tilghman at mail.jeffandtilghman.com>:
> On Wednesday 06 May 2009 10:57:30 Chris Maciejewski wrote:
>> I am not sure if it is a bug, but Asterisk SVN-branch-1.6.1-r190371 +
>> Addons 1.6.1 behaves in the following way:
>
> It's not a bug.
>
>> So looks like 'NULL' value fetched from MySQL table is not considered
>> 'NULL' by ISNULL function??!!!
>
> The ISNULL function is not related to the database function in any way.  In
> some ways, it's rather poorly named, because the intent of the function is
> to measure whether or not the value of the variable is blank, which the string
> "NULL" certainly is not.
>
> --
> Tilghman
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>



More information about the asterisk-dev mailing list