@@ -127,7 +127,6 @@ slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
127127 if (slot -> tts_tupleDescriptor -> constr )
128128 attrmiss = slot -> tts_tupleDescriptor -> constr -> missing ;
129129
130-
131130 if (!attrmiss )
132131 {
133132 /* no missing values array at all, so just fill everything in as NULL */
@@ -139,9 +138,9 @@ slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
139138 else
140139 {
141140 /* if there is a missing values array we must process them one by one */
142- for (missattnum = lastAttNum - 1 ;
143- missattnum >= startAttNum ;
144- missattnum -- )
141+ for (missattnum = startAttNum ;
142+ missattnum < lastAttNum ;
143+ missattnum ++ )
145144 {
146145 slot -> tts_values [missattnum ] = attrmiss [missattnum ].ammissing ;
147146 slot -> tts_isnull [missattnum ] =
@@ -1636,6 +1635,8 @@ slot_getallattrs(TupleTableSlot *slot)
16361635
16371636 slot_deform_tuple (slot , attnum );
16381637
1638+ attnum = slot -> tts_nvalid ;
1639+
16391640 /*
16401641 * If tuple doesn't have all the atts indicated by tupleDesc, read the
16411642 * rest as NULLS or missing values.
@@ -1681,8 +1682,10 @@ slot_getsomeattrs(TupleTableSlot *slot, int attnum)
16811682
16821683 slot_deform_tuple (slot , attno );
16831684
1685+ attno = slot -> tts_nvalid ;
1686+
16841687 /*
1685- * If tuple doesn't have all the atts indicated by tupleDesc , read the
1688+ * If tuple doesn't have all the atts indicated by attnum , read the
16861689 * rest as NULLs or missing values
16871690 */
16881691 if (attno < attnum )
0 commit comments