]> granicus.if.org Git - postgresql/commit
Preserve AND/OR flatness while extracting restriction OR clauses.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Sep 2014 22:35:17 +0000 (18:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Sep 2014 22:35:41 +0000 (18:35 -0400)
commitf003419791f35eeab0150cd097bcf7929622b0fc
tree39409d14d8bd337c1dbb23cd9a7c46920fad923d
parent21dcc48dc7ec48bf7b2a40c619e1c96ca4d2477c
Preserve AND/OR flatness while extracting restriction OR clauses.

The code I added in commit f343a880d5555faf1dad0286c5632047c8f599ad was
careless about preserving AND/OR flatness: it could create a structure with
an OR node directly underneath another one.  That breaks an assumption
that's fairly important for planning efficiency, not to mention triggering
various Asserts (as reported by Benjamin Smith).  Add a trifle more logic
to handle the case properly.
src/backend/optimizer/util/orclauses.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql