Skip to content

Commit ef86ae9

Browse files
svenklemmhackorum
authored andcommitted
Handle SK_SEARCHNULL and SK_SEARCHNOTNULL in HeapKeyTest
Change HeapKeyTest to not return false on SK_ISNULL but instead return a result according to SK_SEARCHNULL/SK_SEARCHNOTNULL.
1 parent b91f79c commit ef86ae9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/include/access/valid.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ HeapKeyTest(HeapTuple tuple, TupleDesc tupdesc, int nkeys, ScanKey keys)
3737
Datum test;
3838

3939
if (cur_key->sk_flags & SK_ISNULL)
40-
return false;
40+
{
41+
Assert(cur_key->sk_flags & (SK_SEARCHNULL | SK_SEARCHNOTNULL));
42+
isnull = heap_attisnull(tuple, cur_key->sk_attno, tupdesc);
43+
if (cur_key->sk_flags & SK_SEARCHNULL)
44+
return isnull;
45+
else
46+
return !isnull;
47+
}
4148

4249
atp = heap_getattr(tuple, cur_key->sk_attno, tupdesc, &isnull);
4350

0 commit comments

Comments
 (0)