forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfca8e59
committed
Fix oversight in flattening of subqueries with empty FROM.
I missed a restriction that commitf4abd02should have enforced: we can't pull up an empty-FROM subquery if it's underan outer join, because then we'd need to wrap its output columns inPlaceHolderVars. As the code currently stands, the PHVs end up with emptyrelid sets, which doesn't work (and is correctly caught by an Assert).It's possible that this could be fixed by assigning the PHVs the relidsets of the parent FromExpr/JoinExpr, but getting that to work is morecomplication than I care to add right now; indeed it's likely thatwe'll never bother, since pulling up empty-FROM subqueries is a rathermarginal optimization anyway.Per report from Andreas Seltenreich. Back-patch to 9.5 where the faultycode was added.1 parent358eaa0 commitfca8e59
File tree
3 files changed
+81
-18
lines changed- src
- backend/optimizer/prep
- test/regress
- expected
- sql
3 files changed
+81
-18
lines changedLines changed: 34 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1435 | 1435 |
| |
1436 | 1436 |
| |
1437 | 1437 |
| |
1438 |
| - | |
1439 |
| - | |
1440 |
| - | |
1441 |
| - | |
1442 |
| - | |
1443 |
| - | |
1444 |
| - | |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
1448 |
| - | |
1449 |
| - | |
1450 |
| - | |
1451 |
| - | |
1452 |
| - | |
1453 |
| - | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1454 | 1467 |
| |
1455 | 1468 |
| |
1456 |
| - | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1457 | 1472 |
| |
1458 | 1473 |
| |
1459 | 1474 |
| |
| |||
1667 | 1682 |
| |
1668 | 1683 |
| |
1669 | 1684 |
| |
1670 |
| - | |
| 1685 | + | |
| 1686 | + | |
1671 | 1687 |
| |
1672 | 1688 |
| |
1673 | 1689 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2184 | 2184 |
| |
2185 | 2185 |
| |
2186 | 2186 |
| |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2187 | 2221 |
| |
2188 | 2222 |
| |
2189 | 2223 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
365 | 365 |
| |
366 | 366 |
| |
367 | 367 |
| |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
368 | 381 |
| |
369 | 382 |
| |
370 | 383 |
| |
|
0 commit comments
Comments
(0)