PostgreSQL Source Code  git master
valid.h File Reference
#include "access/htup.h"
#include "access/htup_details.h"
#include "access/skey.h"
#include "access/tupdesc.h"
Include dependency graph for valid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


static bool HeapKeyTest (HeapTuple tuple, TupleDesc tupdesc, int nkeys, ScanKey keys)

Function Documentation

◆ HeapKeyTest()

static bool HeapKeyTest ( HeapTuple  tuple,
TupleDesc  tupdesc,
int  nkeys,
ScanKey  keys 

Definition at line 28 of file valid.h.

29 {
30  int cur_nkeys = nkeys;
31  ScanKey cur_key = keys;
33  for (; cur_nkeys--; cur_key++)
34  {
35  Datum atp;
36  bool isnull;
37  Datum test;
39  if (cur_key->sk_flags & SK_ISNULL)
40  return false;
42  atp = heap_getattr(tuple, cur_key->sk_attno, tupdesc, &isnull);
44  if (isnull)
45  return false;
47  test = FunctionCall2Coll(&cur_key->sk_func,
48  cur_key->sk_collation,
49  atp, cur_key->sk_argument);
51  if (!DatumGetBool(test))
52  return false;
53  }
55  return true;
56 }
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
Definition: fmgr.c:1149
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
Definition: htup_details.h:792
static bool DatumGetBool(Datum X)
Definition: postgres.h:90
uintptr_t Datum
Definition: postgres.h:64
static void test(void)
#define SK_ISNULL
Definition: skey.h:115
int sk_flags
Definition: skey.h:66
Datum sk_argument
Definition: skey.h:72
FmgrInfo sk_func
Definition: skey.h:71
Oid sk_collation
Definition: skey.h:70
AttrNumber sk_attno
Definition: skey.h:67

References DatumGetBool(), FunctionCall2Coll(), heap_getattr(), ScanKeyData::sk_argument, ScanKeyData::sk_attno, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, SK_ISNULL, and test().

Referenced by heapgettup(), and heapgettup_pagemode().