@@ -63,7 +63,7 @@ static bool _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
6363 bool * continuescan , int * ikey );
6464static bool _bt_check_rowcompare (ScanKey skey ,
6565 IndexTuple tuple , int tupnatts , TupleDesc tupdesc ,
66- ScanDirection dir , bool forcenonrequired , bool * continuescan );
66+ ScanDirection dir , bool * continuescan );
6767static void _bt_checkkeys_look_ahead (IndexScanDesc scan , BTReadPageState * pstate ,
6868 int tupnatts , TupleDesc tupdesc );
6969static int _bt_keep_natts (Relation rel , IndexTuple lastleft ,
@@ -2902,8 +2902,10 @@ _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
29022902 /* row-comparison keys need special processing */
29032903 if (key -> sk_flags & SK_ROW_HEADER )
29042904 {
2905+ Assert (!forcenonrequired ); /* forbidden by _bt_set_startikey */
2906+
29052907 if (_bt_check_rowcompare (key , tuple , tupnatts , tupdesc , dir ,
2906- forcenonrequired , continuescan ))
2908+ continuescan ))
29072909 continue ;
29082910 return false;
29092911 }
@@ -3060,8 +3062,7 @@ _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
30603062 */
30613063static bool
30623064_bt_check_rowcompare (ScanKey skey , IndexTuple tuple , int tupnatts ,
3063- TupleDesc tupdesc , ScanDirection dir ,
3064- bool forcenonrequired , bool * continuescan )
3065+ TupleDesc tupdesc , ScanDirection dir , bool * continuescan )
30653066{
30663067 ScanKey subkey = (ScanKey ) DatumGetPointer (skey -> sk_argument );
30673068 int32 cmpresult = 0 ;
@@ -3101,11 +3102,7 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
31013102
31023103 if (isNull )
31033104 {
3104- if (forcenonrequired )
3105- {
3106- /* treating scan's keys as non-required */
3107- }
3108- else if (subkey -> sk_flags & SK_BT_NULLS_FIRST )
3105+ if (subkey -> sk_flags & SK_BT_NULLS_FIRST )
31093106 {
31103107 /*
31113108 * Since NULLs are sorted before non-NULLs, we know we have
@@ -3159,12 +3156,8 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
31593156 */
31603157 Assert (subkey != (ScanKey ) DatumGetPointer (skey -> sk_argument ));
31613158 subkey -- ;
3162- if (forcenonrequired )
3163- {
3164- /* treating scan's keys as non-required */
3165- }
3166- else if ((subkey -> sk_flags & SK_BT_REQFWD ) &&
3167- ScanDirectionIsForward (dir ))
3159+ if ((subkey -> sk_flags & SK_BT_REQFWD ) &&
3160+ ScanDirectionIsForward (dir ))
31683161 * continuescan = false;
31693162 else if ((subkey -> sk_flags & SK_BT_REQBKWD ) &&
31703163 ScanDirectionIsBackward (dir ))
@@ -3216,7 +3209,7 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
32163209 break ;
32173210 }
32183211
3219- if (!result && ! forcenonrequired )
3212+ if (!result )
32203213 {
32213214 /*
32223215 * Tuple fails this qual. If it's a required qual for the current
0 commit comments