forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite617f0d
committed
Fix improper matching of resjunk column names for FOR UPDATE in subselect.
Flattening of subquery range tables during setrefs.c could lead to therangetable indexes in PlanRowMark nodes not matching up with the columnnames previously assigned to the corresponding resjunk ctid (resp. tableoidor wholerow) columns. Typical symptom would be either a "cannot extractsystem attribute from virtual tuple" error or an Assert failure. Thiswasn't a problem before 9.0 because we didn't support FOR UPDATE below thetop query level, and so the final flattening could never renumber an RTEthat was relevant to FOR UPDATE. Fix by using a plan-tree-wide uniquenumber for each PlanRowMark to label the associated resjunk columns, sothat the number need not change during flattening.Per report from David Johnston (though I'm darned if I can see how this gotpast initial testing of the relevant code). Back-patch to 9.0.1 parent5478f99 commite617f0d
File tree
10 files changed
+30
-8
lines changed- src
- backend
- executor
- nodes
- optimizer
- plan
- prep
- include/nodes
10 files changed
+30
-8
lines changedLines changed: 10 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
742 | 742 |
| |
743 | 743 |
| |
744 | 744 |
| |
| 745 | + | |
745 | 746 |
| |
746 | 747 |
| |
747 | 748 |
| |
| |||
1425 | 1426 |
| |
1426 | 1427 |
| |
1427 | 1428 |
| |
1428 |
| - | |
| 1429 | + | |
1429 | 1430 |
| |
1430 | 1431 |
| |
| 1432 | + | |
| 1433 | + | |
1431 | 1434 |
| |
1432 | 1435 |
| |
1433 | 1436 |
| |
1434 |
| - | |
| 1437 | + | |
1435 | 1438 |
| |
1436 | 1439 |
| |
| 1440 | + | |
| 1441 | + | |
1437 | 1442 |
| |
1438 | 1443 |
| |
1439 | 1444 |
| |
1440 | 1445 |
| |
1441 | 1446 |
| |
1442 |
| - | |
| 1447 | + | |
1443 | 1448 |
| |
1444 | 1449 |
| |
| 1450 | + | |
| 1451 | + | |
1445 | 1452 |
| |
1446 | 1453 |
| |
1447 | 1454 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
906 | 906 |
| |
907 | 907 |
| |
908 | 908 |
| |
| 909 | + | |
909 | 910 |
| |
910 | 911 |
| |
911 | 912 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
808 | 808 |
| |
809 | 809 |
| |
810 | 810 |
| |
| 811 | + | |
811 | 812 |
| |
812 | 813 |
| |
813 | 814 |
| |
| |||
1609 | 1610 |
| |
1610 | 1611 |
| |
1611 | 1612 |
| |
| 1613 | + | |
1612 | 1614 |
| |
1613 | 1615 |
| |
1614 | 1616 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
| 169 | + | |
169 | 170 |
| |
170 | 171 |
| |
171 | 172 |
| |
| |||
1885 | 1886 |
| |
1886 | 1887 |
| |
1887 | 1888 |
| |
| 1889 | + | |
1888 | 1890 |
| |
1889 | 1891 |
| |
1890 | 1892 |
| |
| |||
1910 | 1912 |
| |
1911 | 1913 |
| |
1912 | 1914 |
| |
| 1915 | + | |
1913 | 1916 |
| |
1914 | 1917 |
| |
1915 | 1918 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
252 | 252 |
| |
253 | 253 |
| |
254 | 254 |
| |
255 |
| - | |
| 255 | + | |
256 | 256 |
| |
257 | 257 |
| |
258 | 258 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
105 |
| - | |
| 105 | + | |
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
| |||
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
121 |
| - | |
| 121 | + | |
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
| 135 | + | |
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1294 | 1294 |
| |
1295 | 1295 |
| |
1296 | 1296 |
| |
| 1297 | + | |
1297 | 1298 |
| |
1298 | 1299 |
| |
1299 | 1300 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
417 | 417 |
| |
418 | 418 |
| |
419 | 419 |
| |
| 420 | + | |
420 | 421 |
| |
421 | 422 |
| |
422 | 423 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
749 | 749 |
| |
750 | 750 |
| |
751 | 751 |
| |
752 |
| - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
753 | 757 |
| |
754 | 758 |
| |
755 | 759 |
| |
| |||
759 | 763 |
| |
760 | 764 |
| |
761 | 765 |
| |
| 766 | + | |
762 | 767 |
| |
763 | 768 |
| |
764 | 769 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
| 85 | + | |
| 86 | + | |
85 | 87 |
| |
86 | 88 |
| |
87 | 89 |
| |
|
0 commit comments
Comments
(0)