LCOV - differential code coverage report
Current view: top level - src/backend/access/rmgrdesc - smgrdesc.c (source / functions) Coverage Total Hit UNC UBC DUB
Current: Differential Code Coverage HEAD vs 15 Lines: 0.0 % 24 0 2 22 2
Current Date: 2023-04-08 15:15:32 Functions: 0.0 % 2 0 1 1
Baseline: 15
Baseline Date: 2023-04-08 15:09:40
Legend: Lines: hit not hit

           TLA  Line data    Source code
       1                 : /*-------------------------------------------------------------------------
       2                 :  *
       3                 :  * smgrdesc.c
       4                 :  *    rmgr descriptor routines for catalog/storage.c
       5                 :  *
       6                 :  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
       7                 :  * Portions Copyright (c) 1994, Regents of the University of California
       8                 :  *
       9                 :  *
      10                 :  * IDENTIFICATION
      11                 :  *    src/backend/access/rmgrdesc/smgrdesc.c
      12                 :  *
      13                 :  *-------------------------------------------------------------------------
      14                 :  */
      15                 : #include "postgres.h"
      16                 : 
      17                 : #include "catalog/storage_xlog.h"
      18                 : 
      19                 : 
      20                 : void
      21 UBC           0 : smgr_desc(StringInfo buf, XLogReaderState *record)
      22                 : {
      23               0 :     char       *rec = XLogRecGetData(record);
      24               0 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
      25                 : 
      26               0 :     if (info == XLOG_SMGR_CREATE)
      27                 :     {
      28               0 :         xl_smgr_create *xlrec = (xl_smgr_create *) rec;
      29 UNC           0 :         char       *path = relpathperm(xlrec->rlocator, xlrec->forkNum);
      30                 : 
      31 UBC           0 :         appendStringInfoString(buf, path);
      32               0 :         pfree(path);
      33                 :     }
      34               0 :     else if (info == XLOG_SMGR_TRUNCATE)
      35                 :     {
      36               0 :         xl_smgr_truncate *xlrec = (xl_smgr_truncate *) rec;
      37 UNC           0 :         char       *path = relpathperm(xlrec->rlocator, MAIN_FORKNUM);
      38                 : 
      39 UBC           0 :         appendStringInfo(buf, "%s to %u blocks flags %d", path,
      40                 :                          xlrec->blkno, xlrec->flags);
      41               0 :         pfree(path);
      42                 :     }
      43               0 : }
      44                 : 
      45                 : const char *
      46               0 : smgr_identify(uint8 info)
      47                 : {
      48               0 :     const char *id = NULL;
      49                 : 
      50               0 :     switch (info & ~XLR_INFO_MASK)
      51                 :     {
      52               0 :         case XLOG_SMGR_CREATE:
      53               0 :             id = "CREATE";
      54               0 :             break;
      55               0 :         case XLOG_SMGR_TRUNCATE:
      56               0 :             id = "TRUNCATE";
      57               0 :             break;
      58                 :     }
      59                 : 
      60               0 :     return id;
      61                 : }
        

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