Page 1 of 1

IsNullOrEmpty not working correctly

Posted: Tue 25 Aug 2009 14:32
by dilbert
Hello,
it's nice that method string.IsNullOrEmpty() was implemented. However, it's not working correctly in dotConnect for MySQL 5.40.39.

Following code:

Code: Select all

from eq in DB.ExamQuestions
where string.IsNullOrEmpty(eq.Question)
select eq.Question
is translated into this SQL code:

Code: Select all

SELECT t1.Question
FROM db.exam_question t1
WHERE t1.Question IS NULL
It's wrong. The condition should be:

Code: Select all

WHERE t1.Question IS NULL OR t1.Question = ''
Thanks for attention.

Posted: Wed 26 Aug 2009 15:34
by Shalex
Thank you for the bug report. The problem is fixed. Look forward to the next build of dotConnect for MySQL.

Posted: Fri 28 Aug 2009 07:21
by lnu
Hello,

same problem happens with dotconnect for Oracle

best regards,

Laurent

Posted: Fri 28 Aug 2009 08:10
by Shalex
Thank you for the report. The problem is fixed for all dotConnects.

Posted: Fri 04 Sep 2009 14:36
by Shalex
The new builds of dotConnects are available for download now.

Posted: Fri 04 Sep 2009 15:42
by dilbert
Thank you for your support.

Posted: Tue 15 Sep 2009 08:11
by Paul
This is not a problem for Oracle server, because values NULL and '' in VARCHAR2 column are equivalent.
So it is enough to check t1.Question IS NULL