LCOV - differential code coverage report
Current view: top level - src/backend/access/rmgrdesc - spgdesc.c (source / functions) Coverage Total Hit UNC UBC DUB
Current: Differential Code Coverage HEAD vs 15 Lines: 0.0 % 106 0 1 105 1
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                 :  * spgdesc.c
       4                 :  *    rmgr descriptor routines for access/spgist/spgxlog.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/spgdesc.c
      12                 :  *
      13                 :  *-------------------------------------------------------------------------
      14                 :  */
      15                 : #include "postgres.h"
      16                 : 
      17                 : #include "access/spgxlog.h"
      18                 : 
      19                 : void
      20 UBC           0 : spg_desc(StringInfo buf, XLogReaderState *record)
      21                 : {
      22               0 :     char       *rec = XLogRecGetData(record);
      23               0 :     uint8       info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
      24                 : 
      25               0 :     switch (info)
      26                 :     {
      27               0 :         case XLOG_SPGIST_ADD_LEAF:
      28                 :             {
      29               0 :                 spgxlogAddLeaf *xlrec = (spgxlogAddLeaf *) rec;
      30                 : 
      31               0 :                 appendStringInfo(buf, "off: %u, headoff: %u, parentoff: %u, nodeI: %u",
      32               0 :                                  xlrec->offnumLeaf, xlrec->offnumHeadLeaf,
      33               0 :                                  xlrec->offnumParent, xlrec->nodeI);
      34               0 :                 if (xlrec->newPage)
      35               0 :                     appendStringInfoString(buf, " (newpage)");
      36               0 :                 if (xlrec->storesNulls)
      37               0 :                     appendStringInfoString(buf, " (nulls)");
      38                 :             }
      39               0 :             break;
      40               0 :         case XLOG_SPGIST_MOVE_LEAFS:
      41                 :             {
      42               0 :                 spgxlogMoveLeafs *xlrec = (spgxlogMoveLeafs *) rec;
      43                 : 
      44               0 :                 appendStringInfo(buf, "nmoves: %u, parentoff: %u, nodeI: %u",
      45               0 :                                  xlrec->nMoves,
      46               0 :                                  xlrec->offnumParent, xlrec->nodeI);
      47               0 :                 if (xlrec->newPage)
      48               0 :                     appendStringInfoString(buf, " (newpage)");
      49               0 :                 if (xlrec->replaceDead)
      50               0 :                     appendStringInfoString(buf, " (replacedead)");
      51               0 :                 if (xlrec->storesNulls)
      52               0 :                     appendStringInfoString(buf, " (nulls)");
      53                 :             }
      54               0 :             break;
      55               0 :         case XLOG_SPGIST_ADD_NODE:
      56                 :             {
      57               0 :                 spgxlogAddNode *xlrec = (spgxlogAddNode *) rec;
      58                 : 
      59               0 :                 appendStringInfo(buf, "off: %u, newoff: %u, parentBlk: %d, "
      60                 :                                  "parentoff: %u, nodeI: %u",
      61               0 :                                  xlrec->offnum,
      62               0 :                                  xlrec->offnumNew,
      63               0 :                                  xlrec->parentBlk,
      64               0 :                                  xlrec->offnumParent,
      65               0 :                                  xlrec->nodeI);
      66               0 :                 if (xlrec->newPage)
      67               0 :                     appendStringInfoString(buf, " (newpage)");
      68                 :             }
      69               0 :             break;
      70               0 :         case XLOG_SPGIST_SPLIT_TUPLE:
      71                 :             {
      72               0 :                 spgxlogSplitTuple *xlrec = (spgxlogSplitTuple *) rec;
      73                 : 
      74               0 :                 appendStringInfo(buf, "prefixoff: %u, postfixoff: %u",
      75               0 :                                  xlrec->offnumPrefix,
      76               0 :                                  xlrec->offnumPostfix);
      77               0 :                 if (xlrec->newPage)
      78               0 :                     appendStringInfoString(buf, " (newpage)");
      79               0 :                 if (xlrec->postfixBlkSame)
      80               0 :                     appendStringInfoString(buf, " (same)");
      81                 :             }
      82               0 :             break;
      83               0 :         case XLOG_SPGIST_PICKSPLIT:
      84                 :             {
      85               0 :                 spgxlogPickSplit *xlrec = (spgxlogPickSplit *) rec;
      86                 : 
      87               0 :                 appendStringInfo(buf, "ndelete: %u, ninsert: %u, inneroff: %u, "
      88                 :                                  "parentoff: %u, nodeI: %u",
      89               0 :                                  xlrec->nDelete, xlrec->nInsert,
      90               0 :                                  xlrec->offnumInner,
      91               0 :                                  xlrec->offnumParent, xlrec->nodeI);
      92               0 :                 if (xlrec->innerIsParent)
      93               0 :                     appendStringInfoString(buf, " (innerIsParent)");
      94               0 :                 if (xlrec->storesNulls)
      95               0 :                     appendStringInfoString(buf, " (nulls)");
      96               0 :                 if (xlrec->isRootSplit)
      97               0 :                     appendStringInfoString(buf, " (isRootSplit)");
      98                 :             }
      99               0 :             break;
     100               0 :         case XLOG_SPGIST_VACUUM_LEAF:
     101                 :             {
     102               0 :                 spgxlogVacuumLeaf *xlrec = (spgxlogVacuumLeaf *) rec;
     103                 : 
     104               0 :                 appendStringInfo(buf, "ndead: %u, nplaceholder: %u, nmove: %u, nchain: %u",
     105               0 :                                  xlrec->nDead, xlrec->nPlaceholder,
     106               0 :                                  xlrec->nMove, xlrec->nChain);
     107                 :             }
     108               0 :             break;
     109               0 :         case XLOG_SPGIST_VACUUM_ROOT:
     110                 :             {
     111               0 :                 spgxlogVacuumRoot *xlrec = (spgxlogVacuumRoot *) rec;
     112                 : 
     113               0 :                 appendStringInfo(buf, "ndelete: %u",
     114               0 :                                  xlrec->nDelete);
     115                 :             }
     116               0 :             break;
     117               0 :         case XLOG_SPGIST_VACUUM_REDIRECT:
     118                 :             {
     119               0 :                 spgxlogVacuumRedirect *xlrec = (spgxlogVacuumRedirect *) rec;
     120                 : 
     121 UNC           0 :                 appendStringInfo(buf, "ntoplaceholder: %u, firstplaceholder: %u, snapshotConflictHorizon: %u",
     122 UBC           0 :                                  xlrec->nToPlaceholder,
     123               0 :                                  xlrec->firstPlaceholder,
     124                 :                                  xlrec->snapshotConflictHorizon);
     125                 :             }
     126               0 :             break;
     127                 :     }
     128               0 : }
     129                 : 
     130                 : const char *
     131               0 : spg_identify(uint8 info)
     132                 : {
     133               0 :     const char *id = NULL;
     134                 : 
     135               0 :     switch (info & ~XLR_INFO_MASK)
     136                 :     {
     137               0 :         case XLOG_SPGIST_ADD_LEAF:
     138               0 :             id = "ADD_LEAF";
     139               0 :             break;
     140               0 :         case XLOG_SPGIST_MOVE_LEAFS:
     141               0 :             id = "MOVE_LEAFS";
     142               0 :             break;
     143               0 :         case XLOG_SPGIST_ADD_NODE:
     144               0 :             id = "ADD_NODE";
     145               0 :             break;
     146               0 :         case XLOG_SPGIST_SPLIT_TUPLE:
     147               0 :             id = "SPLIT_TUPLE";
     148               0 :             break;
     149               0 :         case XLOG_SPGIST_PICKSPLIT:
     150               0 :             id = "PICKSPLIT";
     151               0 :             break;
     152               0 :         case XLOG_SPGIST_VACUUM_LEAF:
     153               0 :             id = "VACUUM_LEAF";
     154               0 :             break;
     155               0 :         case XLOG_SPGIST_VACUUM_ROOT:
     156               0 :             id = "VACUUM_ROOT";
     157               0 :             break;
     158               0 :         case XLOG_SPGIST_VACUUM_REDIRECT:
     159               0 :             id = "VACUUM_REDIRECT";
     160               0 :             break;
     161                 :     }
     162                 : 
     163               0 :     return id;
     164                 : }
        

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