LCOV - code coverage report
Current view: top level - src/backend/access/rmgrdesc - spgdesc.c (source / functions) Hit Total Coverage
Test: PostgreSQL 15devel Lines: 0 106 0.0 %
Date: 2021-12-04 22:09:09 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * spgdesc.c
       4             :  *    rmgr descriptor routines for access/spgist/spgxlog.c
       5             :  *
       6             :  * Portions Copyright (c) 1996-2021, 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           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           0 :                 appendStringInfo(buf, "ntoplaceholder: %u, firstplaceholder: %u, newestredirectxid: %u",
     122           0 :                                  xlrec->nToPlaceholder,
     123           0 :                                  xlrec->firstPlaceholder,
     124             :                                  xlrec->newestRedirectXid);
     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 1.14