* reach end of partition, we will leave frameheadpos = end+1 and
* framehead_slot empty.
*/
+ int sortCol = node->ordColIdx[0];
bool sub,
less;
bool headisnull,
currisnull;
- headval = slot_getattr(winstate->framehead_slot, 1,
+ headval = slot_getattr(winstate->framehead_slot, sortCol,
&headisnull);
- currval = slot_getattr(winstate->ss.ss_ScanTupleSlot, 1,
+ currval = slot_getattr(winstate->ss.ss_ScanTupleSlot, sortCol,
&currisnull);
if (headisnull || currisnull)
{
* necessary. Note that if we reach end of partition, we will
* leave frametailpos = end+1 and frametail_slot empty.
*/
+ int sortCol = node->ordColIdx[0];
bool sub,
less;
bool tailisnull,
currisnull;
- tailval = slot_getattr(winstate->frametail_slot, 1,
+ tailval = slot_getattr(winstate->frametail_slot, sortCol,
&tailisnull);
- currval = slot_getattr(winstate->ss.ss_ScanTupleSlot, 1,
+ currval = slot_getattr(winstate->ss.ss_ScanTupleSlot, sortCol,
&currisnull);
if (tailisnull || currisnull)
{