aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/createlang.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-12-14 17:33:53 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-12-14 17:33:53 -0500
commitc03ad5602f529787968fa3201b35c119bbc6d782 (patch)
tree476e5dd44970877cbb83cd1bedf1fd6fdd0e4056 /src/bin/scripts/createlang.c
parent60eea3780c40fe7ac0332d83173947199e59f5cd (diff)
downloadpostgresql-c03ad5602f529787968fa3201b35c119bbc6d782.tar.gz
postgresql-c03ad5602f529787968fa3201b35c119bbc6d782.zip
Fix inherited UPDATE/DELETE with UNION ALL subqueries.
Fix an oversight in commit b3aaf9081a1a95c245fd605dcf02c91b3a5c3a29: we do indeed need to process the planner's append_rel_list when copying RTE subqueries, because if any of them were flattenable UNION ALL subqueries, the append_rel_list shows which subquery RTEs were pulled up out of which other ones. Without this, UNION ALL subqueries aren't correctly inserted into the update plans for inheritance child tables after the first one, typically resulting in no update happening for those child table(s). Per report from Victor Yegorov. Experimentation with this case also exposed a fault in commit a7b965382cf0cb30aeacb112572718045e6d4be7: if an inherited UPDATE/DELETE was proven totally dummy by constraint exclusion, we might arrive at add_rtes_to_flat_rtable with root->simple_rel_array being NULL. This should be interpreted as not having any RelOptInfos. I chose to code the guard as a check against simple_rel_array_size, so as to also provide some protection against indexing off the end of the array. Back-patch to 9.2 where the faulty code was added.
Diffstat (limited to 'src/bin/scripts/createlang.c')
0 files changed, 0 insertions, 0 deletions