diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2024-04-16 11:22:39 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2024-04-16 11:22:39 -0400 |
commit | d9e4ee74f48c4478bf644be166188e00af1f9158 (patch) | |
tree | c04b426eeee9ef65626fed70a8a3491939f29b21 /src/backend/utils/adt/tsquery_util.c | |
parent | bb418aeee27078e2f3955a131515c151173143bd (diff) | |
download | postgresql-d9e4ee74f48c4478bf644be166188e00af1f9158.tar.gz postgresql-d9e4ee74f48c4478bf644be166188e00af1f9158.zip |
Fix generation of EC join conditions at the wrong plan level.
get_baserel_parampathinfo previously assumed without checking that
the results of generate_join_implied_equalities "necessarily satisfy
join_clause_is_movable_into". This turns out to be wrong in the
presence of outer joins, because the generated clauses could include
Vars that mustn't be evaluated below a relevant outer join. That
led to applying clauses at the wrong plan level and possibly getting
incorrect query results. We must check each clause's nullable_relids,
and really the right thing to do is test join_clause_is_movable_into.
However, trying to fix it that way exposes an oversight in
equivclass.c: it wasn't careful about marking join clauses for
appendrel children with the correct clause_relids. That caused the
modified get_baserel_parampathinfo code to reject some clauses it
still needs to accept. (See parallel commit for HEAD/v16 for more
commentary about that.)
Per bug #18429 from BenoƮt Ryder. This misbehavior existed for
a long time before commit 2489d76c4, so patch v12-v15 this way.
Discussion: https://postgr.es/m/18429-8982d4a348cc86c6@postgresql.org
Diffstat (limited to 'src/backend/utils/adt/tsquery_util.c')
0 files changed, 0 insertions, 0 deletions