forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb919a97
committed
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.
To deparse a reference to a field of a RECORD-type output of asubquery, EXPLAIN normally digs down into the subquery's plan to tryto discover exactly which anonymous RECORD type is meant. However,this can fail if the subquery has been optimized out of the planaltogether on the grounds that no rows could pass the WHERE quals,which has been possible at least since3fc6e2d. There isn'tanything remaining in the plan tree that would help us, so fall backto printing the field name as "fN" for the N'th column of the record.(This will actually be the right thing some of the time, since itmatches the column names we assign to RowExprs.)In passing, fix a comment typo in create_projection_plan, whichI noticed while experimenting with an alternative fix for this.Per bug #18576 from Vasya B. Back-patch to all supported branches.Richard Guo and Tom LaneDiscussion:https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org1 parent7da1bdc commitb919a97
File tree
4 files changed
+113
-14
lines changed- src
- backend
- optimizer/plan
- utils/adt
- test/regress
- expected
- sql
4 files changed
+113
-14
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2022 | 2022 |
| |
2023 | 2023 |
| |
2024 | 2024 |
| |
2025 |
| - | |
| 2025 | + | |
2026 | 2026 |
| |
2027 | 2027 |
| |
2028 | 2028 |
| |
|
Lines changed: 37 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7895 | 7895 |
| |
7896 | 7896 |
| |
7897 | 7897 |
| |
7898 |
| - | |
7899 |
| - | |
7900 |
| - | |
| 7898 | + | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + | |
| 7902 | + | |
| 7903 | + | |
| 7904 | + | |
| 7905 | + | |
| 7906 | + | |
| 7907 | + | |
7901 | 7908 |
| |
7902 | 7909 |
| |
7903 | 7910 |
| |
7904 | 7911 |
| |
7905 | 7912 |
| |
7906 | 7913 |
| |
7907 |
| - | |
7908 |
| - | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
7909 | 7923 |
| |
7910 | 7924 |
| |
7911 | 7925 |
| |
| |||
8014 | 8028 |
| |
8015 | 8029 |
| |
8016 | 8030 |
| |
8017 |
| - | |
8018 |
| - | |
8019 |
| - | |
8020 |
| - | |
8021 |
| - | |
8022 |
| - | |
| 8031 | + | |
| 8032 | + | |
| 8033 | + | |
| 8034 | + | |
| 8035 | + | |
| 8036 | + | |
| 8037 | + | |
| 8038 | + | |
8023 | 8039 |
| |
8024 | 8040 |
| |
8025 | 8041 |
| |
8026 | 8042 |
| |
8027 | 8043 |
| |
8028 | 8044 |
| |
8029 |
| - | |
8030 |
| - | |
| 8045 | + | |
| 8046 | + | |
| 8047 | + | |
| 8048 | + | |
| 8049 | + | |
| 8050 | + | |
| 8051 | + | |
| 8052 | + | |
| 8053 | + | |
| 8054 | + | |
8031 | 8055 |
| |
8032 | 8056 |
| |
8033 | 8057 |
| |
|
Lines changed: 54 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1300 | 1300 |
| |
1301 | 1301 |
| |
1302 | 1302 |
| |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1303 | 1357 |
| |
1304 | 1358 |
| |
1305 | 1359 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
520 | 520 |
| |
521 | 521 |
| |
522 | 522 |
| |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
523 | 544 |
| |
524 | 545 |
| |
525 | 546 |
| |
|
0 commit comments
Comments
(0)