Commit b9734c1
committed
Fix crash in postgres_fdw for provably-empty remote UPDATE/DELETE.
In 86dc900, I'd written find_modifytable_subplan with the assumption
that if the immediate child of a ModifyTable is a Result, it must be
a projecting Result with a subplan. However, if the UPDATE or DELETE
has a provably-constant-false WHERE clause, that's not so: we'll
generate a dummy subplan with a childless Result. Add the missing
null-check so we don't crash on such cases.
Per report from Alexander Pyhalov.
Discussion: https://postgr.es/m/b9a6f53549456b2f3e2fd150dcd79d72@postgrespro.ru1 parent 9d2a775 commit b9734c1
File tree
3 files changed
+27
-1
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6853 | 6853 | | |
6854 | 6854 | | |
6855 | 6855 | | |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
| 6871 | + | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
6856 | 6876 | | |
6857 | 6877 | | |
6858 | 6878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2370 | 2370 | | |
2371 | 2371 | | |
2372 | 2372 | | |
2373 | | - | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
2374 | 2376 | | |
2375 | 2377 | | |
2376 | 2378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1738 | 1738 | | |
1739 | 1739 | | |
1740 | 1740 | | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
1741 | 1745 | | |
1742 | 1746 | | |
1743 | 1747 | | |
| |||
0 commit comments