Thread: pgsql: Get rid of adjust_appendrel_attr_needed(), which has been broken
pgsql: Get rid of adjust_appendrel_attr_needed(), which has been broken
From
tgl@postgresql.org (Tom Lane)
Date:
Log Message: ----------- Get rid of adjust_appendrel_attr_needed(), which has been broken ever since we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead. Modified Files: -------------- pgsql/src/backend/nodes: copyfuncs.c (r1.410 -> r1.411) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.410&r2=1.411) equalfuncs.c (r1.335 -> r1.336) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.335&r2=1.336) outfuncs.c (r1.343 -> r1.344) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.343&r2=1.344) pgsql/src/backend/optimizer/path: allpaths.c (r1.175 -> r1.176) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/allpaths.c?r1=1.175&r2=1.176) pgsql/src/backend/optimizer/prep: prepjointree.c (r1.58 -> r1.59) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c?r1=1.58&r2=1.59) prepunion.c (r1.160 -> r1.161) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.160&r2=1.161) pgsql/src/include/nodes: relation.h (r1.163 -> r1.164) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.163&r2=1.164) pgsql/src/include/optimizer: prep.h (r1.62 -> r1.63) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/prep.h?r1=1.62&r2=1.63)