Commit 78a030a
committed
Fix confusion about number of subplans in partitioned INSERT setup.
ExecInitModifyTable() thought there was a plan per partition, but no,
there's only one. The problem had escaped detection so far because there
would only be visible misbehavior if there were a SubPlan (not an InitPlan)
in the quals being duplicated for each partition. However, valgrind
detected a bogus memory access in test cases added by commit 4f7a95b,
and investigation of that led to discovery of the bug. The additional
test case added here crashes without the patch.
Patch by Amit Langote, test case by me.
Discussion: https://postgr.es/m/10974.1497227727@sss.pgh.pa.us1 parent 791ef00 commit 78a030a
File tree
3 files changed
+33
-5
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+33
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1841 | 1841 | | |
1842 | 1842 | | |
1843 | 1843 | | |
| 1844 | + | |
1844 | 1845 | | |
1845 | | - | |
1846 | | - | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
1847 | 1856 | | |
| 1857 | + | |
| 1858 | + | |
1848 | 1859 | | |
1849 | 1860 | | |
1850 | 1861 | | |
| |||
1858 | 1869 | | |
1859 | 1870 | | |
1860 | 1871 | | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1864 | 1875 | | |
1865 | 1876 | | |
1866 | 1877 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1327 | 1327 | | |
1328 | 1328 | | |
1329 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1330 | 1338 | | |
1331 | 1339 | | |
1332 | 1340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
| |||
0 commit comments