@@ -63,7 +63,7 @@ static bool _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
63
63
bool * continuescan , int * ikey );
64
64
static bool _bt_check_rowcompare (ScanKey skey ,
65
65
IndexTuple tuple , int tupnatts , TupleDesc tupdesc ,
66
- ScanDirection dir , bool forcenonrequired , bool * continuescan );
66
+ ScanDirection dir , bool * continuescan );
67
67
static void _bt_checkkeys_look_ahead (IndexScanDesc scan , BTReadPageState * pstate ,
68
68
int tupnatts , TupleDesc tupdesc );
69
69
static int _bt_keep_natts (Relation rel , IndexTuple lastleft ,
@@ -2902,8 +2902,10 @@ _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
2902
2902
/* row-comparison keys need special processing */
2903
2903
if (key -> sk_flags & SK_ROW_HEADER )
2904
2904
{
2905
+ Assert (!forcenonrequired ); /* forbidden by _bt_set_startikey */
2906
+
2905
2907
if (_bt_check_rowcompare (key , tuple , tupnatts , tupdesc , dir ,
2906
- forcenonrequired , continuescan ))
2908
+ continuescan ))
2907
2909
continue ;
2908
2910
return false;
2909
2911
}
@@ -3060,8 +3062,7 @@ _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
3060
3062
*/
3061
3063
static bool
3062
3064
_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 )
3065
3066
{
3066
3067
ScanKey subkey = (ScanKey ) DatumGetPointer (skey -> sk_argument );
3067
3068
int32 cmpresult = 0 ;
@@ -3101,11 +3102,7 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
3101
3102
3102
3103
if (isNull )
3103
3104
{
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 )
3109
3106
{
3110
3107
/*
3111
3108
* Since NULLs are sorted before non-NULLs, we know we have
@@ -3159,12 +3156,8 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
3159
3156
*/
3160
3157
Assert (subkey != (ScanKey ) DatumGetPointer (skey -> sk_argument ));
3161
3158
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 ))
3168
3161
* continuescan = false;
3169
3162
else if ((subkey -> sk_flags & SK_BT_REQBKWD ) &&
3170
3163
ScanDirectionIsBackward (dir ))
@@ -3216,7 +3209,7 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
3216
3209
break ;
3217
3210
}
3218
3211
3219
- if (!result && ! forcenonrequired )
3212
+ if (!result )
3220
3213
{
3221
3214
/*
3222
3215
* Tuple fails this qual. If it's a required qual for the current
0 commit comments