OSDN Git Service

Rule rewriter was doing the wrong thing with conditional INSTEAD rules
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Oct 2002 00:58:55 +0000 (00:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Oct 2002 00:58:55 +0000 (00:58 +0000)
commita044e2abddfe96a4309d4e8b3ac1cc603f8d50ad
tree1eaa0d72b9a694a9ffbff941a8f89284aa9b4cbe
parent6d6b5828500e348580faf6bdda69fe62fc0faa28
Rule rewriter was doing the wrong thing with conditional INSTEAD rules
whose conditions might yield NULL.  The negated qual to attach to the
original query is properly 'x IS NOT TRUE', not 'NOT x'.  This fix
produces correct behavior, but we may be taking a performance hit because
the planner is much stupider about IS NOT TRUE than it is about NOT
clauses.  Future TODO: teach prepqual, other parts of planner how to
cope with BooleanTest clauses more effectively.
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteManip.c
src/include/rewrite/rewriteManip.h