Kurt Roeckx <Q(at)ping(dot)be> writes:
> On Wed, Dec 10, 2003 at 04:54:54PM -0500, Tom Lane wrote:
>> (a AND b) OR (a AND c)
>> expands by repeated application of the distributive law to
>> (a OR a) AND (a OR c) AND (b OR a) AND (b OR c)
> This is wrong.
I don't think so. The distributive law is
a OR (b AND c) == (a OR b) AND (a OR c)
Starting from
(a AND b) OR (x AND y)
prepqual.c applies the law once to produce
((a AND b) OR x) AND ((a AND b) OR y)
and then twice more to obtain
(a OR x) AND (b OR x) AND (a OR y) AND (b OR y)
Taking a equal to x gives the case I quoted.
The real problem is that we want to run the distributive law backwards,
not forwards ...
regards, tom lane