Repair bug reported by Wickstrom: backend would crash if WHERE clause

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 9d91db4fdeaa32d2680b08fe15f62599ffd22c83
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2000-04-14T00:19:17Z
Releases: 7.1.1
Repair bug reported by Wickstrom: backend would crash if WHERE clause
contained a sub-SELECT nested within an AND/OR tree that cnfify()
thought it should rearrange.  Same physical sub-SELECT node could
end up linked into multiple places in resulting expression tree.
This is harmless for most node types, but not for SubLink.
Repair bug by making physical copies of subexpressions that get
logically duplicated by cnfify().  Also, tweak the heuristic that
decides whether it's a good idea to do cnfify() --- we don't really
want that to happen when it would cause multiple copies of a subselect
to be generated, I think.

Files