Commit 98ee736
committed
Patch Turso hash-join planner for correlated subqueries
The join planner picks hash-join for tables inside a correlated subquery
(current query block has non-empty outer_query_refs). The hash build
runs once before outer-column refs are bound, so equality predicates
against outer columns evaluate against NULL and produce 0 rows in the
hash table. Every probe then misses, the scalar subquery returns NULL,
and an outer WHERE filter on the alias discards everything.
Repro: testInformationSchemaTablesFilterByAutoIncrement — the
cols x sqlite_sequence join inside the AUTO_INCREMENT correlated
subquery.
Refuse hash-join when the current query block is itself correlated.
Falls back to nested-loop, which re-evaluates per outer row.
Worth reporting upstream — independent of mysql-on-sqlite.1 parent 2ef2068 commit 98ee736
1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
641 | 679 | | |
642 | 680 | | |
643 | 681 | | |
| |||
0 commit comments