IsNullOrEmpty not working correctly

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

IsNullOrEmpty not working correctly

Post by dilbert » Tue 25 Aug 2009 14:32

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.

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 26 Aug 2009 15:34

Thank you for the bug report. The problem is fixed. Look forward to the next build of dotConnect for MySQL.

lnu
Posts: 7
Joined: Tue 25 Aug 2009 15:14

Post by lnu » Fri 28 Aug 2009 07:21

Hello,

same problem happens with dotconnect for Oracle

best regards,

Laurent

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 28 Aug 2009 08:10

Thank you for the report. The problem is fixed for all dotConnects.

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 04 Sep 2009 14:36

The new builds of dotConnects are available for download now.

dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Post by dilbert » Fri 04 Sep 2009 15:42

Thank you for your support.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 15 Sep 2009 08:11

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

Post Reply