2222 *
2323 *
2424 * IDENTIFICATION
25- * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.142 2007/06/11 01:16:23 tgl Exp $
25+ * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.143 2007/07/12 18:27:01 tgl Exp $
2626 *
2727 *-------------------------------------------------------------------------
2828 */
@@ -1288,8 +1288,6 @@ adjust_appendrel_attr_needed(RelOptInfo *oldrel, AppendRelInfo *appinfo,
12881288ListCell * lm ;
12891289
12901290/* Create empty result array */
1291- Assert (new_min_attr <=oldrel -> min_attr );
1292- Assert (new_max_attr >=oldrel -> max_attr );
12931291new_attr_needed = (Relids * )
12941292palloc0 ((new_max_attr - new_min_attr + 1 )* sizeof (Relids ));
12951293/* Process user attributes, with appropriate attno mapping */
@@ -1312,6 +1310,7 @@ adjust_appendrel_attr_needed(RelOptInfo *oldrel, AppendRelInfo *appinfo,
13121310parent_attr ++ ;
13131311}
13141312/* Process system attributes, including whole-row references */
1313+ Assert (new_min_attr <=oldrel -> min_attr );
13151314for (parent_attr = oldrel -> min_attr ;parent_attr <=0 ;parent_attr ++ )
13161315{
13171316Relids attrneeded ;