forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita7d71c4
committed
Fix mishandling of OLD/NEW references in subqueries in rule actions.
If a rule action contains a subquery that refers to columns from OLDor NEW, then those are really lateral references, and the planner willcomplain if it sees such things in a subquery that isn't marked aslateral. However, at rule-definition time, the user isn't required tomark the subquery with LATERAL, and so it can fail when the rule isused.Fix this by marking such subqueries as lateral in the rewriter, at thepoint where they're used.Dean Rasheed and Tom Lane, per report from Alexander Lakhin.Back-patch to all supported branches.Discussion:https://postgr.es/m/5e09da43-aaba-7ea7-0a51-a2eb981b058b%40gmail.com1 parent05fc551 commita7d71c4
File tree
3 files changed
+60
-4
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+60
-4
lines changedLines changed: 18 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
353 | 353 |
| |
354 | 354 |
| |
355 | 355 |
| |
| 356 | + | |
356 | 357 |
| |
357 | 358 |
| |
358 | 359 |
| |
| |||
391 | 392 |
| |
392 | 393 |
| |
393 | 394 |
| |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
394 | 412 |
| |
395 | 413 |
| |
396 | 414 |
| |
| |||
439 | 457 |
| |
440 | 458 |
| |
441 | 459 |
| |
442 |
| - | |
443 |
| - | |
444 | 460 |
| |
445 | 461 |
| |
446 | 462 |
| |
| |||
538 | 554 |
| |
539 | 555 |
| |
540 | 556 |
| |
541 |
| - | |
542 |
| - | |
543 | 557 |
| |
544 | 558 |
| |
545 | 559 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3083 | 3083 |
| |
3084 | 3084 |
| |
3085 | 3085 |
| |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
3086 | 3111 |
| |
3087 | 3112 |
| |
3088 | 3113 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1046 | 1046 |
| |
1047 | 1047 |
| |
1048 | 1048 |
| |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1049 | 1066 |
| |
1050 | 1067 |
| |
1051 | 1068 |
| |
|
0 commit comments
Comments
(0)