IsNullOrEmpty not working correctly

IsNullOrEmpty not working correctly

Postby 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.
dilbert
 
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Postby 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.
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44

Postby lnu » Fri 28 Aug 2009 07:21

Hello,

same problem happens with dotconnect for Oracle

best regards,

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

Postby Shalex » Fri 28 Aug 2009 08:10

Thank you for the report. The problem is fixed for all dotConnects.
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44

Postby Shalex » Fri 04 Sep 2009 14:36

The new builds of dotConnects are available for download now.
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44

Postby dilbert » Fri 04 Sep 2009 15:42

Thank you for your support.
dilbert
 
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Postby 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
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06


Return to LinqConnect (LINQ to SQL support)