forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd31e794
committed
Fix eclass_useful_for_merging to give valid results for appendrel children.
Formerly, this function would always return "true" for an appendrel childrelation, because it would think that the appendrel parent was a potentialjoin target for the child. In principle that should only lead to someinefficiency in planning, but fuzz testing by Andreas Seltenreich disclosedthat it could lead to "could not find pathkey item to sort" planner errorsin odd corner cases. Specifically, we would think that all columns of achild table's multicolumn index were interesting pathkeys, causing us togenerate a MergeAppend path that sorts by all the columns. However, if anyof those columns weren't actually used above the level of the appendrel,they would not get added to that rel's targetlist, which would result inbeing unable to resolve the MergeAppend's sort keys against its targetlistduring createplan.c.Backpatch to 9.3. In older versions, columns of an appendrel get addedto its targetlist even if they're not mentioned above the scan level,so that the failure doesn't occur. It might be worth back-patching thisfix to older versions anyway, but I'll refrain for the moment.1 parent7ef507a commitd31e794
File tree
5 files changed
+69
-5
lines changed- src
- backend/optimizer/path
- include/optimizer
- test/regress
- expected
- sql
5 files changed
+69
-5
lines changedLines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2286 | 2286 |
| |
2287 | 2287 |
| |
2288 | 2288 |
| |
2289 |
| - | |
| 2289 | + | |
| 2290 | + | |
2290 | 2291 |
| |
2291 | 2292 |
| |
| 2293 | + | |
2292 | 2294 |
| |
2293 | 2295 |
| |
2294 | 2296 |
| |
| |||
2306 | 2308 |
| |
2307 | 2309 |
| |
2308 | 2310 |
| |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2309 | 2317 |
| |
2310 |
| - | |
| 2318 | + | |
2311 | 2319 |
| |
2312 | 2320 |
| |
2313 | 2321 |
| |
| |||
2318 | 2326 |
| |
2319 | 2327 |
| |
2320 | 2328 |
| |
2321 |
| - | |
| 2329 | + | |
2322 | 2330 |
| |
2323 | 2331 |
| |
2324 | 2332 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1373 | 1373 |
| |
1374 | 1374 |
| |
1375 | 1375 |
| |
1376 |
| - | |
| 1376 | + | |
1377 | 1377 |
| |
1378 | 1378 |
| |
1379 | 1379 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
133 |
| - | |
| 133 | + | |
| 134 | + | |
134 | 135 |
| |
135 | 136 |
| |
136 | 137 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1307 | 1307 |
| |
1308 | 1308 |
| |
1309 | 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 | + | |
1310 | 1344 |
| |
1311 | 1345 |
| |
1312 | 1346 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
402 | 402 |
| |
403 | 403 |
| |
404 | 404 |
| |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
405 | 426 |
| |
406 | 427 |
| |
407 | 428 |
| |
|
0 commit comments
Comments
(0)