LCOV - differential code coverage report
Current view: top level - src/backend/utils/adt - skipsupport.c (source / functions) Coverage Total Hit GNC CBC DCB
Current: 806555e3000d0b0e0c536c1dc65548128d457d86 vs 1d325ad99cb2dec0e8b45ba36909ee0a497d2a57 Lines: 100.0 % 14 14 1 13 1
Current Date: 2025-12-17 08:58:58 +0900 Functions: 100.0 % 1 1 1
Baseline: lcov-20251217-005640-baseline Branches: 100.0 % 4 4 4
Baseline Date: 2025-12-16 12:57:12 -0800 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(1,7] days: 100.0 % 1 1 1
(30,360] days: 100.0 % 13 13 13
Function coverage date bins:
(30,360] days: 100.0 % 1 1 1
Branch coverage date bins:
(30,360] days: 100.0 % 4 4 4

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * skipsupport.c
                                  4                 :                :  *    Support routines for B-Tree skip scan.
                                  5                 :                :  *
                                  6                 :                :  *
                                  7                 :                :  * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
                                  8                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  9                 :                :  *
                                 10                 :                :  * IDENTIFICATION
                                 11                 :                :  *    src/backend/utils/adt/skipsupport.c
                                 12                 :                :  *
                                 13                 :                :  *-------------------------------------------------------------------------
                                 14                 :                :  */
                                 15                 :                : 
                                 16                 :                : #include "postgres.h"
                                 17                 :                : 
                                 18                 :                : #include "access/nbtree.h"
                                 19                 :                : #include "utils/lsyscache.h"
                                 20                 :                : #include "utils/skipsupport.h"
                                 21                 :                : 
                                 22                 :                : /*
                                 23                 :                :  * Fill in SkipSupport given an operator class (opfamily + opcintype).
                                 24                 :                :  *
                                 25                 :                :  * On success, returns skip support struct, allocating in caller's memory
                                 26                 :                :  * context.  Otherwise returns NULL, indicating that operator class has no
                                 27                 :                :  * skip support function.
                                 28                 :                :  */
                                 29                 :                : SkipSupport
  257 pg@bowt.ie                 30                 :CBC        1942 : PrepareSkipSupportFromOpclass(Oid opfamily, Oid opcintype, bool reverse)
                                 31                 :                : {
                                 32                 :                :     Oid         skipSupportFunction;
                                 33                 :                :     SkipSupport sksup;
                                 34                 :                : 
                                 35                 :                :     /* Look for a skip support function */
                                 36                 :           1942 :     skipSupportFunction = get_opfamily_proc(opfamily, opcintype, opcintype,
                                 37                 :                :                                             BTSKIPSUPPORT_PROC);
                                 38         [ +  + ]:           1942 :     if (!OidIsValid(skipSupportFunction))
                                 39                 :            268 :         return NULL;
                                 40                 :                : 
    7 michael@paquier.xyz        41                 :GNC        1674 :     sksup = palloc_object(SkipSupportData);
  257 pg@bowt.ie                 42                 :CBC        1674 :     OidFunctionCall1(skipSupportFunction, PointerGetDatum(sksup));
                                 43                 :                : 
                                 44         [ +  + ]:           1674 :     if (reverse)
                                 45                 :                :     {
                                 46                 :                :         /*
                                 47                 :                :          * DESC/reverse case: swap low_elem with high_elem, and swap decrement
                                 48                 :                :          * with increment
                                 49                 :                :          */
                                 50                 :             36 :         Datum       low_elem = sksup->low_elem;
                                 51                 :             36 :         SkipSupportIncDec decrement = sksup->decrement;
                                 52                 :                : 
                                 53                 :             36 :         sksup->low_elem = sksup->high_elem;
                                 54                 :             36 :         sksup->decrement = sksup->increment;
                                 55                 :                : 
                                 56                 :             36 :         sksup->high_elem = low_elem;
                                 57                 :             36 :         sksup->increment = decrement;
                                 58                 :                :     }
                                 59                 :                : 
                                 60                 :           1674 :     return sksup;
                                 61                 :                : }
        

Generated by: LCOV version 2.4-beta