LCOV - code coverage report
Current view: top level - src/bin/pg_waldump - spgdesc.c (source / functions) Hit Total Coverage
Test: PostgreSQL 12beta1 Lines: 0 59 0.0 %
Date: 2019-06-16 15:06:48 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-2019, 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             :         case XLOG_SPGIST_ADD_LEAF:
      28             :             {
      29           0 :                 spgxlogAddLeaf *xlrec = (spgxlogAddLeaf *) rec;
      30             : 
      31           0 :                 appendStringInfoString(buf, "add leaf to page");
      32           0 :                 appendStringInfo(buf, "; off %u; headoff %u; parentoff %u",
      33           0 :                                  xlrec->offnumLeaf, xlrec->offnumHeadLeaf,
      34           0 :                                  xlrec->offnumParent);
      35           0 :                 if (xlrec->newPage)
      36           0 :                     appendStringInfoString(buf, " (newpage)");
      37           0 :                 if (xlrec->storesNulls)
      38           0 :                     appendStringInfoString(buf, " (nulls)");
      39             :             }
      40           0 :             break;
      41             :         case XLOG_SPGIST_MOVE_LEAFS:
      42           0 :             appendStringInfo(buf, "%u leafs",
      43           0 :                              ((spgxlogMoveLeafs *) rec)->nMoves);
      44           0 :             break;
      45             :         case XLOG_SPGIST_ADD_NODE:
      46           0 :             appendStringInfo(buf, "off %u",
      47           0 :                              ((spgxlogAddNode *) rec)->offnum);
      48           0 :             break;
      49             :         case XLOG_SPGIST_SPLIT_TUPLE:
      50           0 :             appendStringInfo(buf, "prefix off: %u, postfix off: %u (same %d, new %d)",
      51           0 :                              ((spgxlogSplitTuple *) rec)->offnumPrefix,
      52           0 :                              ((spgxlogSplitTuple *) rec)->offnumPostfix,
      53           0 :                              ((spgxlogSplitTuple *) rec)->postfixBlkSame,
      54           0 :                              ((spgxlogSplitTuple *) rec)->newPage
      55             :                 );
      56           0 :             break;
      57             :         case XLOG_SPGIST_PICKSPLIT:
      58             :             {
      59           0 :                 spgxlogPickSplit *xlrec = (spgxlogPickSplit *) rec;
      60             : 
      61           0 :                 appendStringInfo(buf, "ndel %u; nins %u",
      62           0 :                                  xlrec->nDelete, xlrec->nInsert);
      63           0 :                 if (xlrec->innerIsParent)
      64           0 :                     appendStringInfoString(buf, " (innerIsParent)");
      65           0 :                 if (xlrec->isRootSplit)
      66           0 :                     appendStringInfoString(buf, " (isRootSplit)");
      67             :             }
      68           0 :             break;
      69             :         case XLOG_SPGIST_VACUUM_LEAF:
      70             :             /* no further information */
      71           0 :             break;
      72             :         case XLOG_SPGIST_VACUUM_ROOT:
      73             :             /* no further information */
      74           0 :             break;
      75             :         case XLOG_SPGIST_VACUUM_REDIRECT:
      76           0 :             appendStringInfo(buf, "newest XID %u",
      77             :                              ((spgxlogVacuumRedirect *) rec)->newestRedirectXid);
      78           0 :             break;
      79             :     }
      80           0 : }
      81             : 
      82             : const char *
      83           0 : spg_identify(uint8 info)
      84             : {
      85           0 :     const char *id = NULL;
      86             : 
      87           0 :     switch (info & ~XLR_INFO_MASK)
      88             :     {
      89             :         case XLOG_SPGIST_ADD_LEAF:
      90           0 :             id = "ADD_LEAF";
      91           0 :             break;
      92             :         case XLOG_SPGIST_MOVE_LEAFS:
      93           0 :             id = "MOVE_LEAFS";
      94           0 :             break;
      95             :         case XLOG_SPGIST_ADD_NODE:
      96           0 :             id = "ADD_NODE";
      97           0 :             break;
      98             :         case XLOG_SPGIST_SPLIT_TUPLE:
      99           0 :             id = "SPLIT_TUPLE";
     100           0 :             break;
     101             :         case XLOG_SPGIST_PICKSPLIT:
     102           0 :             id = "PICKSPLIT";
     103           0 :             break;
     104             :         case XLOG_SPGIST_VACUUM_LEAF:
     105           0 :             id = "VACUUM_LEAF";
     106           0 :             break;
     107             :         case XLOG_SPGIST_VACUUM_ROOT:
     108           0 :             id = "VACUUM_ROOT";
     109           0 :             break;
     110             :         case XLOG_SPGIST_VACUUM_REDIRECT:
     111           0 :             id = "VACUUM_REDIRECT";
     112           0 :             break;
     113             :     }
     114             : 
     115           0 :     return id;
     116             : }

Generated by: LCOV version 1.13