I havn't been able to find any more serious issues in the Coverity
report, now that they've fixed the ereport() issue. A number of the
issues it complains about are things we already Assert() for. For the
rest, as long as the following assumptions are true we're done (well,
except for ECPG). I think they are true but it's always good to check:
src/backend/executor/nodeMaterial.c function ExecMaterial if( !node->randomAccess && !ScanDirectionIsForward &&
!node->eof_underlying) dies line 87
randomAccess is set if EXEC_FLAG_BACKWARD is set, but does that guarentee it will never be tried?
src/backend/optimizer/plan/planner.c function inheritance_planner
If the bulk of the loop is skipped for any reason, we segfault right after. This can only happen if ((PlannerInfo
*)root)->append_rel_listis empty or only contains the resultRelation. I can't convince myself this is always ok. The
conditionthat invokes this function in subquery_planner is obtuse enough that I can't trigger it.
src/backend/utils/adt/selfuncs.c function like_selectivity
Assume this function is never called with a zero length bytea constant. It just looks wierd to set patt to NULL only
toAssert() it three lines down.
src/backend/utils/adt/ruleutils.c function get_sublink_expr
We assume sublink->subLinkType == ANY_SUBLINK implies sublink->testexpr != NULL. Otherwise we die at line 4114.
src/backend/rewrite/rewriteHandler.c function AcquireRewriteLocks
Assume ((Var*)var)->varno > 0
src/backend/executor/execMain.c function ExecutePlan
We assume an UPDATE statement always has a junkfilter.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.