I get the same behavior in my copy of 4.0.17. This looks like a bug to me, so I've submitted it as one <http://bugs.mysql.com/bug.php?id=3756>.

Michael

Toro Hill wrote:

Hi everyone. I seem to be getting some funny results when I combine the IFNULL and QUOTE functions. Maybe I have overlooked something I can't see what.

Anyway here's the situation.
SELECT version();
4.0.18-max-debug-log

The query I'm having problems with is as follows:
SELECT attachment,
QUOTE(attachment),
IFNULL( QUOTE(attachment), 'NULLVALUE' ),
IF( ISNULL( QUOTE(attachment) ), 'NULLVALUE', QUOTE(attachment) ),
IF( ISNULL( attachment ), 'NULLVALUE', QUOTE(attachment) )
FROM notes WHERE parent=2408


I get two rows with the following values.


(NULL),(NULL),NULLVALUE,NULLVALUE,NULLVALUE
32645.html,'32645.html',NULLVALUE,NULLVALUE,'32645.html'

The first row of results is fine.
The question I have is about the third and fourth value in the second row. Surely these values should not be NULLVALUE because there is no way that QUOTE(attachment) is null for this row, as illustrated by the second value in that row.


Sure I can use the result from the fifth column, but I don't understand why the the third or fourth columns don't have the values that I would expect.

Thanks in advance.
Toro





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to