LCOV - differential code coverage report
Current view: top level - src/include/access - valid.h (source / functions) Coverage Total Hit UNC GNC DUB DCB
Current: Differential Code Coverage HEAD vs 15 Lines: 92.3 % 13 12 1 12 1 12
Current Date: 2023-04-08 17:13:01 Functions: 100.0 % 1 1 1 1
Baseline: 15 Line coverage date bins:
Baseline Date: 2023-04-08 15:09:40 (120,180] days: 92.3 % 13 12 1 12
Legend: Lines: hit not hit Function coverage date bins:
(120,180] days: 100.0 % 1 1 1

 Age         Owner                  TLA  Line data    Source code
                                  1                 : /*-------------------------------------------------------------------------
                                  2                 :  *
                                  3                 :  * valid.h
                                  4                 :  *    POSTGRES tuple qualification validity definitions.
                                  5                 :  *
                                  6                 :  *
                                  7                 :  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
                                  8                 :  * Portions Copyright (c) 1994, Regents of the University of California
                                  9                 :  *
                                 10                 :  * src/include/access/valid.h
                                 11                 :  *
                                 12                 :  *-------------------------------------------------------------------------
                                 13                 :  */
                                 14                 : #ifndef VALID_H
                                 15                 : #define VALID_H
                                 16                 : 
                                 17                 : #include "access/htup.h"
                                 18                 : #include "access/htup_details.h"
                                 19                 : #include "access/skey.h"
                                 20                 : #include "access/tupdesc.h"
                                 21                 : 
                                 22                 : /*
                                 23                 :  *      HeapKeyTest
                                 24                 :  *
                                 25                 :  *      Test a heap tuple to see if it satisfies a scan key.
                                 26                 :  */
                                 27                 : static inline bool
  144 peter                      28 GNC   145561268 : HeapKeyTest(HeapTuple tuple, TupleDesc tupdesc, int nkeys, ScanKey keys)
                                 29                 : {
                                 30       145561268 :     int         cur_nkeys = nkeys;
                                 31       145561268 :     ScanKey     cur_key = keys;
                                 32                 : 
                                 33       147343735 :     for (; cur_nkeys--; cur_key++)
                                 34                 :     {
                                 35                 :         Datum       atp;
                                 36                 :         bool        isnull;
                                 37                 :         Datum       test;
                                 38                 : 
                                 39       146424869 :         if (cur_key->sk_flags & SK_ISNULL)
                                 40       144642402 :             return false;
                                 41                 : 
                                 42       146424869 :         atp = heap_getattr(tuple, cur_key->sk_attno, tupdesc, &isnull);
                                 43                 : 
                                 44       146424869 :         if (isnull)
  144 peter                      45 UNC           0 :             return false;
                                 46                 : 
  144 peter                      47 GNC   146424869 :         test = FunctionCall2Coll(&cur_key->sk_func,
                                 48                 :                                  cur_key->sk_collation,
                                 49                 :                                  atp, cur_key->sk_argument);
                                 50                 : 
                                 51       146424869 :         if (!DatumGetBool(test))
                                 52       144642402 :             return false;
                                 53                 :     }
                                 54                 : 
                                 55          918866 :     return true;
                                 56                 : }
                                 57                 : 
                                 58                 : #endif                          /* VALID_H */
        

Generated by: LCOV version v1.16-55-g56c0a2a