PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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.

Functions

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 
)
inlinestatic

Definition at line 28 of file valid.h.

29{
30 int cur_nkeys = nkeys;
31 ScanKey cur_key = keys;
32
33 for (; cur_nkeys--; cur_key++)
34 {
35 Datum atp;
36 bool isnull;
37 Datum test;
38
39 if (cur_key->sk_flags & SK_ISNULL)
40 return false;
41
42 atp = heap_getattr(tuple, cur_key->sk_attno, tupdesc, &isnull);
43
44 if (isnull)
45 return false;
46
47 test = FunctionCall2Coll(&cur_key->sk_func,
48 cur_key->sk_collation,
49 atp, cur_key->sk_argument);
50
51 if (!DatumGetBool(test))
52 return false;
53 }
54
55 return true;
56}
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
Definition fmgr.c:1150
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static bool DatumGetBool(Datum X)
Definition postgres.h:100
uint64_t Datum
Definition postgres.h:70
static void test(void)
static int fb(int x)
#define SK_ISNULL
Definition skey.h:115

References DatumGetBool(), fb(), FunctionCall2Coll(), heap_getattr(), SK_ISNULL, and test().

Referenced by heapgettup(), and heapgettup_pagemode().