|
Other databases (like PostgreSQL) allow to use subqueries that get limited number of rows in the IN(...) clause, similar to this:
SELECT ... FROM ... WHERE outer_expr IN (SELECT inner_expr FROM ... [ORDER BY ...] LIMIT n)
and the semantics is to first apply the LIMIT clause to the subquery output and then make the "outer_col IN (...)" check.
It would be nice to add support for this specific case of LIMIT in subqueries (with ORDER BY or without), as now we get a generic error message:
ERROR 1235 (42000): This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
This specific case of IN subquery support should be implemented separately as it conflicts with current IN->EXISTS rewrite that is unique to IN subqueries.
|