CROSS APPLY in dotconnect for MySql

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

CROSS APPLY in dotconnect for MySql

Post by dilbert » Tue 25 Aug 2009 14:42

Hello again,
another bug in dotConnect for MySQL 5.40.39

Following query (that is simplified and therefore meaningless):

Code: Select all

from eq in DB.ExamQuestions
from eqe in DB.ExamQuestionExplanations.Where(eqe => eq.Id_explanation == eqe.Id)
from ef in DB.ExamFigures.Where(ef => eq.Id == ef.Id_question).DefaultIfEmpty()
select new { eq.Id }
is translated into this SQL code:

Code: Select all

SELECT t1.Id
FROM db.exam_question t1
CROSS APPLY (
    SELECT NULL 
    FROM db.exam_question_explanation t3
    WHERE t1.Id_explanation = t3.Id
    ) t2
LEFT OUTER JOIN db.exam_figure t4 ON t1.Id = t4.Id_question
that throws exception because CROSS APPLY is not valid MySql clause. It's clause from T-SQL.

Thanks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 26 Aug 2009 15:32

We cannot translate such query without CROSS APPLY which is not supported by the server. Please try to redesign your query.

Post Reply