LCOV - code coverage report
Current view: top level - src/backend/access/tablesample - tablesample.c (source / functions) Coverage Total Hit
Test: Code coverage Lines: 88.9 % 9 8
Test Date: 2026-01-26 10:56:24 Functions: 100.0 % 1 1
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 16.7 % 6 1

             Branch data     Line data    Source code
       1                 :             : /*-------------------------------------------------------------------------
       2                 :             :  *
       3                 :             :  * tablesample.c
       4                 :             :  *                Support functions for TABLESAMPLE feature
       5                 :             :  *
       6                 :             :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
       7                 :             :  * Portions Copyright (c) 1994, Regents of the University of California
       8                 :             :  *
       9                 :             :  *
      10                 :             :  * IDENTIFICATION
      11                 :             :  *                src/backend/access/tablesample/tablesample.c
      12                 :             :  *
      13                 :             :  * -------------------------------------------------------------------------
      14                 :             :  */
      15                 :             : 
      16                 :             : #include "postgres.h"
      17                 :             : 
      18                 :             : #include "access/tsmapi.h"
      19                 :             : 
      20                 :             : 
      21                 :             : /*
      22                 :             :  * GetTsmRoutine --- get a TsmRoutine struct by invoking the handler.
      23                 :             :  *
      24                 :             :  * This is a convenience routine that's just meant to check for errors.
      25                 :             :  */
      26                 :             : TsmRoutine *
      27                 :         182 : GetTsmRoutine(Oid tsmhandler)
      28                 :             : {
      29                 :         182 :         Datum           datum;
      30                 :         182 :         TsmRoutine *routine;
      31                 :             : 
      32                 :         182 :         datum = OidFunctionCall1(tsmhandler, PointerGetDatum(NULL));
      33                 :         182 :         routine = (TsmRoutine *) DatumGetPointer(datum);
      34                 :             : 
      35         [ +  - ]:         182 :         if (routine == NULL || !IsA(routine, TsmRoutine))
      36   [ #  #  #  # ]:           0 :                 elog(ERROR, "tablesample handler function %u did not return a TsmRoutine struct",
      37                 :             :                          tsmhandler);
      38                 :             : 
      39                 :         364 :         return routine;
      40                 :         182 : }
        

Generated by: LCOV version 2.3.2-1