Skip to content

Conversation

@smuuf
Copy link
Contributor

@smuuf smuuf commented Oct 14, 2020

As MySQL/MariaDB clearly does support subqueries.

This enables proper building of queries like...

$table('table_a')
  ->where(
    'table_a.column_one IN',
    $table('table_b')->select('value')
  )

... without executing the inner query first.

See https://dev.mysql.com/doc/refman/8.0/en/subqueries.html
and https://mariadb.com/kb/en/subqueries/

  • bug fix / new feature? Both, I think.
  • BC break? Who knows.

As MySQL/MariaDB clearly does support subqueries.

This enables proper building of queries like...
```
$table('table_a')->where('table_a.column_one IN', $table('table_b')->select('value'))
```

... without executing the inner query first.

See https://dev.mysql.com/doc/refman/8.0/en/subqueries.html
and https://mariadb.com/kb/en/subqueries/
@dg
Copy link
Member

dg commented Oct 14, 2020

Thanks

@dg dg merged commit d00fb8a into nette:master Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 15, 2020
dg pushed a commit that referenced this pull request Oct 15, 2020
@smuuf smuuf deleted the patch-1 branch October 17, 2020 18:29
dg pushed a commit that referenced this pull request Oct 25, 2020
dg pushed a commit that referenced this pull request Oct 28, 2020
dg pushed a commit that referenced this pull request Oct 28, 2020
dg pushed a commit that referenced this pull request Oct 29, 2020
dg pushed a commit that referenced this pull request Oct 29, 2020
dg pushed a commit that referenced this pull request Oct 30, 2020
dg pushed a commit that referenced this pull request Nov 6, 2020
dg pushed a commit that referenced this pull request Nov 25, 2020
dg pushed a commit that referenced this pull request Dec 21, 2020
@lulco
Copy link
Contributor

lulco commented Apr 21, 2021

Hi @smuuf and @dg

We just found problematic case here with subqueries:

$table('table_a')
  ->where(
    'table_a.column_one IN',
    $table('table_b')->select('value')->limit(100)
  )

Adding limit to subquery throws error:

This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' 

Mysql doc https://dev.mysql.com/doc/refman/8.0/en/subquery-restrictions.html reads:

MySQL does not support LIMIT in subqueries for certain subquery operators

@dg
Copy link
Member

dg commented Apr 22, 2021

I temporarily reverted it until we found a solution.

dg added a commit that referenced this pull request Apr 22, 2021
This reverts commit e89a34a.

"MySQL does not support LIMIT in subqueries for certain subquery operators" dev.mysql.com/doc/refman/8.0/en/subquery-restrictions.html
dg added a commit that referenced this pull request Apr 22, 2021
This reverts commit e89a34a.

"MySQL does not support LIMIT in subqueries for certain subquery operators" dev.mysql.com/doc/refman/8.0/en/subquery-restrictions.html
@smuuf
Copy link
Contributor Author

smuuf commented Apr 1, 2025

Note to whoever finds this: The mentioned olution seems to exist now - 600997b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants