@@ -127,7 +127,6 @@ slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
127
127
if (slot -> tts_tupleDescriptor -> constr )
128
128
attrmiss = slot -> tts_tupleDescriptor -> constr -> missing ;
129
129
130
-
131
130
if (!attrmiss )
132
131
{
133
132
/* 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)
139
138
else
140
139
{
141
140
/* 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 ++ )
145
144
{
146
145
slot -> tts_values [missattnum ] = attrmiss [missattnum ].ammissing ;
147
146
slot -> tts_isnull [missattnum ] =
@@ -1636,6 +1635,8 @@ slot_getallattrs(TupleTableSlot *slot)
1636
1635
1637
1636
slot_deform_tuple (slot , attnum );
1638
1637
1638
+ attnum = slot -> tts_nvalid ;
1639
+
1639
1640
/*
1640
1641
* If tuple doesn't have all the atts indicated by tupleDesc, read the
1641
1642
* rest as NULLS or missing values.
@@ -1681,8 +1682,10 @@ slot_getsomeattrs(TupleTableSlot *slot, int attnum)
1681
1682
1682
1683
slot_deform_tuple (slot , attno );
1683
1684
1685
+ attno = slot -> tts_nvalid ;
1686
+
1684
1687
/*
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
1686
1689
* rest as NULLs or missing values
1687
1690
*/
1688
1691
if (attno < attnum )
0 commit comments