forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite474c2b
committed
Set correct context for XPath evaluation
According to the SQL standard, the context of XMLTABLE's XPathrow_expression is the document node of the XML input document, not theroot node. This becomes visible when a relative path rather thanabsolute is used as row expression. Absolute paths is what was used inoriginal tests and docs (and the most common form used in examplesthroughout the interwebs), which explains why this wasn't noticedbefore.Other functions such as xpath() and xpath_exists() also have thisproblem. While not specified by the SQL standard, it would be prettyodd to leave those functions to behave differently than XMLTABLE, sochange them too. However, this is a backwards-incompatible change.No backpatch, out of fear of breaking code depending on the originalbroken behavior.Author: Markus WinandReported-By: Markus WinandReviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/0684A598-002C-42A2-AE12-F024A324EAE4@winand.at1 parent425b4c0 commite474c2b
5 files changed
+27
-14
lines changedLines changed: 2 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3934 | 3934 |
| |
3935 | 3935 |
| |
3936 | 3936 |
| |
3937 |
| - | |
3938 |
| - | |
3939 |
| - | |
3940 |
| - | |
| 3937 | + | |
3941 | 3938 |
| |
3942 | 3939 |
| |
3943 | 3940 |
| |
| |||
4276 | 4273 |
| |
4277 | 4274 |
| |
4278 | 4275 |
| |
4279 |
| - | |
4280 |
| - | |
4281 |
| - | |
4282 |
| - | |
| 4276 | + | |
4283 | 4277 |
| |
4284 | 4278 |
| |
4285 | 4279 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
673 | 679 |
| |
674 | 680 |
| |
675 | 681 |
| |
| |||
1212 | 1218 |
| |
1213 | 1219 |
| |
1214 | 1220 |
| |
1215 |
| - | |
| 1221 | + | |
1216 | 1222 |
| |
1217 | 1223 |
| |
1218 | 1224 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
579 | 585 |
| |
580 | 586 |
| |
581 | 587 |
| |
| |||
1067 | 1073 |
| |
1068 | 1074 |
| |
1069 | 1075 |
| |
1070 |
| - | |
| 1076 | + | |
1071 | 1077 |
| |
1072 |
| - | |
1073 |
| - | |
| 1078 | + | |
| 1079 | + | |
1074 | 1080 |
| |
1075 | 1081 |
| |
1076 | 1082 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
650 | 650 |
| |
651 | 651 |
| |
652 | 652 |
| |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
653 | 659 |
| |
654 | 660 |
| |
655 | 661 |
| |
| |||
1192 | 1198 |
| |
1193 | 1199 |
| |
1194 | 1200 |
| |
1195 |
| - | |
| 1201 | + | |
1196 | 1202 |
| |
1197 | 1203 |
| |
1198 | 1204 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
188 | 188 |
| |
189 | 189 |
| |
190 | 190 |
| |
| 191 | + | |
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
| |||
423 | 424 |
| |
424 | 425 |
| |
425 | 426 |
| |
426 |
| - | |
| 427 | + | |
427 | 428 |
| |
428 | 429 |
| |
429 | 430 |
| |
|
0 commit comments
Comments
(0)