MySQL does not support limit and IN/ALL/ANY/SOME subquery

Description

Using the Linq provider can cause invalid SQL when you try to limit your query. If you write statements that generates SQL with an IN clause and also tries to limit your result it will cause an error as MySQL doesn´t support it "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery". Without the limit the query is perfectly valid.

Maybe an inner join would be the solution in this cause instead of the IN statement

Tested: MySQL 5.5.27 & 5.0.67 .NET 4.0

Environment

None

Activity

Show:

Alex Zaytsev May 23, 2013 at 11:47 PM

Following test are failing

OrderByTests.OrderByWithSelfReferencedSubquery1
OrderByTests.OrderByWithSelfReferencedSubquery2

Alex Zaytsev May 9, 2013 at 2:08 PM

Fixed in 3.3.x at 24ee723edcca03a02bda7167796af50456d9a22d

Alex Zaytsev March 7, 2013 at 10:47 PM

Alex Zaytsev January 15, 2013 at 11:14 PM

If wrap subquery with SELECT * FROM ( ... ) ALIAS it works fine. We need to determine what version of MySQL support this and what does not

Alex Zaytsev January 15, 2013 at 11:43 AM

Also these test failing:

Criteria:

  • CriteriaQueryTest.SubqueryPagination

  • CriteriaQueryTest.SubqueryPaginationOnlyWithFirst

  • NH1792.Fixture.PageWithDetachedCriteriaSubqueryWithOrderBy

  • NH2251.Fixture.MultiplePagingParametersInSingleQuery

HQL

  • NH2296.Fixture.Test

Linq:

  • PagingTests.PagedProductsWithOuterWhereClause

  • PagingTests.PagedProductsWithOuterWhereClauseAndComplexProjection

  • PagingTests.PagedProductsWithOuterWhereClauseAndProjection

  • PagingTests.PagedProductsWithOuterWhereClauseEquivalent

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created December 3, 2012 at 11:28 AM
Updated September 14, 2017 at 1:51 AM
Who's Looking?