Fixes for ChangeVarNodes_walker()
Alexander Korotkov <akorotkov@postgresql.org>
Fixes for ChangeVarNodes_walker() This commit fixes two bug in ChangeVarNodes_walker() function. * When considering RestrictInfo, walk down to its clauses based on the presense of relid to be deleted not just in clause_relids but also in required_relids. * Incrementally adjust num_base_rels based on the change of clause_relids instead of recalculating it using clause_relids, which could contain outer-join relids. Reported-by: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAMbWs49PE3CvnV8vrQ0Dr%3DHqgZZmX0tdNbzVNJxqc8yg-8kDQQ%40mail.gmail.com Author: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/rewrite/rewriteManip.c | modified | +24 −4 |
| src/test/regress/expected/join.out | modified | +15 −1 |
| src/test/regress/sql/join.sql | modified | +7 −1 |
Discussion
- Some problems regarding the self-join elimination code 16 messages · 2025-04-02 → 2025-05-01