OSDN Git Service

Fix make_restrictinfo_from_bitmapqual() to preserve AND/OR flatness of its
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Apr 2006 17:05:39 +0000 (17:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Apr 2006 17:05:39 +0000 (17:05 +0000)
commit2f8a7bf2909f7434402a9066d258f74f3e132eb4
treedce7d88e089068b25fbcedfe4c87a1b35862617c
parent0914ae1c1481c2721d57d1c4c3da95a1e0582f7a
Fix make_restrictinfo_from_bitmapqual() to preserve AND/OR flatness of its
output, ie, no OR immediately below an OR.  Otherwise we get Asserts or
wrong answers for cases such as
select * from tenk1 a, tenk1 b
where (a.ten = b.ten and (a.unique1 = 100 or a.unique1 = 101))
   or (a.hundred = b.hundred and a.unique1 = 42);
Per report from Rafael Martinez Guerrero.
src/backend/optimizer/util/restrictinfo.c