forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita9da193
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 parentca2e447 commita9da193
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 | |
---|---|---|---|
| |||
3585 | 3585 |
| |
3586 | 3586 |
| |
3587 | 3587 |
| |
3588 |
| - | |
3589 |
| - | |
| 3588 | + | |
| 3589 | + | |
3590 | 3590 |
| |
3591 | 3591 |
| |
3592 | 3592 |
| |
3593 |
| - | |
| 3593 | + | |
3594 | 3594 |
| |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
3595 | 3608 |
| |
3596 | 3609 |
| |
| 3610 | + | |
3597 | 3611 |
| |
3598 | 3612 |
| |
3599 | 3613 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2969 | 2969 |
| |
2970 | 2970 |
| |
2971 | 2971 |
| |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
2972 | 2997 |
| |
2973 | 2998 |
| |
2974 | 2999 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1375 | 1375 |
| |
1376 | 1376 |
| |
1377 | 1377 |
| |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1378 | 1399 |
| |
1379 | 1400 |
| |
1380 | 1401 |
| |
|
0 commit comments
Comments
(0)