- Notifications
You must be signed in to change notification settings - Fork5
Commit1f91c8c
committed
Avoid planner crash/Assert failure with joins to unflattened subqueries.
examine_simple_variable supposed that any RTE_SUBQUERY rel it gets pointedat must have been planned already. However, this isn't a safe assumptionbecause we must do selectivity estimation while generating indexscan paths,and that code might look at join clauses involving a rel that the loop inset_base_rel_sizes() hasn't reached yet. The simplest fix is to play dumbin such a situation, that is give up trying to extract any stats for theVar. This could possibly be improved by making a separate pass over theRTE list to plan each unflattened subquery before we start the mainplanning work --- but that would be pretty invasive and it doesn't seemworth it, for now at least. (We couldn't just break set_base_rel_sizes()into two loops: the prescan would need to handle all subquery rels in thequery, not only those in the current join subproblem.)This bug was introduced in commit1cb108e,although I think that subsequent changes may have exposed it more than itwas originally. Per bug #7580 from Maxim Boguk.1 parentfe3b5eb commit1f91c8c
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4518 | 4518 |
| |
4519 | 4519 |
| |
4520 | 4520 |
| |
4521 |
| - | |
4522 |
| - | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
4523 | 4525 |
| |
4524 | 4526 |
| |
4525 | 4527 |
| |
|
0 commit comments
Comments
(0)