pgsql: Clear more substructure of a dead relation during join removal.
pgsql: Clear more substructure of a dead relation during join removal.
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Clear more substructure of a dead relation during join removal. The tablesample and securityQuals subtrees of a RangeTblEntry can include Vars, which will cause trouble if they point at a removed rel and are visited during later processing. Hence, clear those fields during join removal, as we already do for the subquery field. remove_useless_outer_joins got this right for securityQuals but not tablesample, while remove_self_join_rel missed doing it for securityQuals. (It escapes trouble for tablesample only because we made a policy decision to never touch sampled relations for SJE.) Oversight in 2ebf25e7d. Back-patch to v16, like that commit (but the SJE issue only goes as far back as v18). Author: shihao zhong Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAGRkXqSOAT1yop44B8jwacL_91rxK=QuoU8Of3NLMb9NgAO2NA@mail.gmail.com Backpatch-through: 16 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0c45929db4825843f5ac2c0a54a65b90a9a541fd Modified Files -------------- src/backend/optimizer/plan/analyzejoins.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)