LCOV - code coverage report
Current view: top level - src/bin/pg_waldump - relmapdesc.c (source / functions) Hit Total Coverage
Test: PostgreSQL 18devel Lines: 14 14 100.0 %
Date: 2024-12-03 07:14:52 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * relmapdesc.c
       4             :  *    rmgr descriptor routines for utils/cache/relmapper.c
       5             :  *
       6             :  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
       7             :  * Portions Copyright (c) 1994, Regents of the University of California
       8             :  *
       9             :  *
      10             :  * IDENTIFICATION
      11             :  *    src/backend/access/rmgrdesc/relmapdesc.c
      12             :  *
      13             :  *-------------------------------------------------------------------------
      14             :  */
      15             : #include "postgres.h"
      16             : 
      17             : #include "utils/relmapper.h"
      18             : 
      19             : void
      20          24 : relmap_desc(StringInfo buf, XLogReaderState *record)
      21             : {
      22          24 :     char       *rec = XLogRecGetData(record);
      23          24 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
      24             : 
      25          24 :     if (info == XLOG_RELMAP_UPDATE)
      26             :     {
      27          24 :         xl_relmap_update *xlrec = (xl_relmap_update *) rec;
      28             : 
      29          24 :         appendStringInfo(buf, "database %u tablespace %u size %d",
      30             :                          xlrec->dbid, xlrec->tsid, xlrec->nbytes);
      31             :     }
      32          24 : }
      33             : 
      34             : const char *
      35          26 : relmap_identify(uint8 info)
      36             : {
      37          26 :     const char *id = NULL;
      38             : 
      39          26 :     switch (info & ~XLR_INFO_MASK)
      40             :     {
      41          26 :         case XLOG_RELMAP_UPDATE:
      42          26 :             id = "UPDATE";
      43          26 :             break;
      44             :     }
      45             : 
      46          26 :     return id;
      47             : }

Generated by: LCOV version 1.14