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

           TLA  Line data    Source code
       1                 : /*-------------------------------------------------------------------------
       2                 :  *
       3                 :  * mxactdesc.c
       4                 :  *    rmgr descriptor routines for access/transam/multixact.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/mxactdesc.c
      12                 :  *
      13                 :  *-------------------------------------------------------------------------
      14                 :  */
      15                 : #include "postgres.h"
      16                 : 
      17                 : #include "access/multixact.h"
      18                 : 
      19                 : static void
      20 UBC           0 : out_member(StringInfo buf, MultiXactMember *member)
      21                 : {
      22               0 :     appendStringInfo(buf, "%u ", member->xid);
      23               0 :     switch (member->status)
      24                 :     {
      25               0 :         case MultiXactStatusForKeyShare:
      26               0 :             appendStringInfoString(buf, "(keysh) ");
      27               0 :             break;
      28               0 :         case MultiXactStatusForShare:
      29               0 :             appendStringInfoString(buf, "(sh) ");
      30               0 :             break;
      31               0 :         case MultiXactStatusForNoKeyUpdate:
      32               0 :             appendStringInfoString(buf, "(fornokeyupd) ");
      33               0 :             break;
      34               0 :         case MultiXactStatusForUpdate:
      35               0 :             appendStringInfoString(buf, "(forupd) ");
      36               0 :             break;
      37               0 :         case MultiXactStatusNoKeyUpdate:
      38               0 :             appendStringInfoString(buf, "(nokeyupd) ");
      39               0 :             break;
      40               0 :         case MultiXactStatusUpdate:
      41               0 :             appendStringInfoString(buf, "(upd) ");
      42               0 :             break;
      43               0 :         default:
      44               0 :             appendStringInfoString(buf, "(unk) ");
      45               0 :             break;
      46                 :     }
      47               0 : }
      48                 : 
      49                 : void
      50               0 : multixact_desc(StringInfo buf, XLogReaderState *record)
      51                 : {
      52               0 :     char       *rec = XLogRecGetData(record);
      53               0 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
      54                 : 
      55               0 :     if (info == XLOG_MULTIXACT_ZERO_OFF_PAGE ||
      56                 :         info == XLOG_MULTIXACT_ZERO_MEM_PAGE)
      57               0 :     {
      58                 :         int         pageno;
      59                 : 
      60               0 :         memcpy(&pageno, rec, sizeof(int));
      61               0 :         appendStringInfo(buf, "%d", pageno);
      62                 :     }
      63               0 :     else if (info == XLOG_MULTIXACT_CREATE_ID)
      64                 :     {
      65               0 :         xl_multixact_create *xlrec = (xl_multixact_create *) rec;
      66                 :         int         i;
      67                 : 
      68               0 :         appendStringInfo(buf, "%u offset %u nmembers %d: ", xlrec->mid,
      69                 :                          xlrec->moff, xlrec->nmembers);
      70               0 :         for (i = 0; i < xlrec->nmembers; i++)
      71               0 :             out_member(buf, &xlrec->members[i]);
      72                 :     }
      73               0 :     else if (info == XLOG_MULTIXACT_TRUNCATE_ID)
      74                 :     {
      75               0 :         xl_multixact_truncate *xlrec = (xl_multixact_truncate *) rec;
      76                 : 
      77               0 :         appendStringInfo(buf, "offsets [%u, %u), members [%u, %u)",
      78                 :                          xlrec->startTruncOff, xlrec->endTruncOff,
      79                 :                          xlrec->startTruncMemb, xlrec->endTruncMemb);
      80                 :     }
      81               0 : }
      82                 : 
      83                 : const char *
      84               0 : multixact_identify(uint8 info)
      85                 : {
      86               0 :     const char *id = NULL;
      87                 : 
      88               0 :     switch (info & ~XLR_INFO_MASK)
      89                 :     {
      90               0 :         case XLOG_MULTIXACT_ZERO_OFF_PAGE:
      91               0 :             id = "ZERO_OFF_PAGE";
      92               0 :             break;
      93               0 :         case XLOG_MULTIXACT_ZERO_MEM_PAGE:
      94               0 :             id = "ZERO_MEM_PAGE";
      95               0 :             break;
      96               0 :         case XLOG_MULTIXACT_CREATE_ID:
      97               0 :             id = "CREATE_ID";
      98               0 :             break;
      99               0 :         case XLOG_MULTIXACT_TRUNCATE_ID:
     100               0 :             id = "TRUNCATE_ID";
     101               0 :             break;
     102                 :     }
     103                 : 
     104               0 :     return id;
     105                 : }
        

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