forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit33e729c
committed
Fix EXPLAIN output for subplans in MERGE.
Given a subplan in a MERGE query, EXPLAIN would sometimes fail toproperly display expressions involving Params referencing variables inother parts of the plan tree.This would affect subplans outside the topmost join plan node, forwhich expansion of Params would go via the top-level ModifyTable plannode. The problem was that "inner_tlist" for the ModifyTable node'sdeparse_namespace was set to the join node's targetlist, but"inner_plan" was set to the ModifyTable node itself, rather than thejoin node, leading to incorrect results when descending to thereferenced variable.Fix and backpatch to v15, where MERGE was introduced.Discussion:https://postgr.es/m/CAEZATCWAv-sZuH%2BwG5xJ-%2BGt7qGNGX8wUQd3XYydMFDKgRB9nw%40mail.gmail.com1 parent20e5810 commit33e729c
File tree
3 files changed
+79
-9
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+79
-9
lines changedLines changed: 12 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4988 | 4988 |
| |
4989 | 4989 |
| |
4990 | 4990 |
| |
4991 |
| - | |
4992 |
| - | |
| 4991 | + | |
| 4992 | + | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + | |
4993 | 4996 |
| |
4994 | 4997 |
| |
4995 | 4998 |
| |
| |||
5004 | 5007 |
| |
5005 | 5008 |
| |
5006 | 5009 |
| |
5007 |
| - | |
5008 |
| - | |
5009 |
| - | |
5010 |
| - | |
5011 |
| - | |
5012 | 5010 |
| |
5013 | 5011 |
| |
5014 |
| - | |
| 5012 | + | |
5015 | 5013 |
| |
5016 |
| - | |
| 5014 | + | |
5017 | 5015 |
| |
| 5016 | + | |
| 5017 | + | |
| 5018 | + | |
| 5019 | + | |
| 5020 | + | |
5018 | 5021 |
| |
5019 | 5022 |
| |
5020 | 5023 |
| |
|
Lines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1473 | 1473 |
| |
1474 | 1474 |
| |
1475 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1476 | 1526 |
| |
1477 | 1527 |
| |
1478 | 1528 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
939 | 939 |
| |
940 | 940 |
| |
941 | 941 |
| |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
942 | 959 |
| |
943 | 960 |
| |
944 | 961 |
| |
|
0 commit comments
Comments
(0)