forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit158594f
committed
Reject cases where a query in WITH rewrites to just NOTIFY.
Since the executor can't cope with a utility statement appearingas a node of a plan tree, we can't support cases where a rewriterule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearingin a WITH clause of a larger query. (One can imagine ways aroundthat, but it'd be a new feature not a bug fix, and so far there'sbeen no demand for it.) RewriteQuery checked for this, but itmissed the case where the DML command rewrites to *only* a NOTIFY.That'd lead to crashes later on in planning. Add the missed check,and improve the level of testing of this area.Per bug #17094 from Yaoguang Chen. It's been busted since WITHwas introduced, so back-patch to all supported branches.Discussion:https://postgr.es/m/17094-bf15dff55eaf2e28@postgresql.org1 parent7e03e3f commit158594f
File tree
3 files changed
+63
-3
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+63
-3
lines changedLines changed: 17 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3436 | 3436 |
| |
3437 | 3437 |
| |
3438 | 3438 |
| |
3439 |
| - | |
3440 |
| - | |
| 3439 | + | |
| 3440 | + | |
3441 | 3441 |
| |
3442 | 3442 |
| |
3443 | 3443 |
| |
3444 |
| - | |
| 3444 | + | |
3445 | 3445 |
| |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
3446 | 3459 |
| |
3447 | 3460 |
| |
| 3461 | + | |
3448 | 3462 |
| |
3449 | 3463 |
| |
3450 | 3464 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2256 | 2256 |
| |
2257 | 2257 |
| |
2258 | 2258 |
| |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2259 | 2284 |
| |
2260 | 2285 |
| |
2261 | 2286 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1022 | 1022 |
| |
1023 | 1023 |
| |
1024 | 1024 |
| |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1025 | 1046 |
| |
1026 | 1047 |
| |
1027 | 1048 |
| |
|
0 commit comments
Comments
(0)