LCOV - code coverage report
Current view: top level - src/backend/access/rmgrdesc - hashdesc.c (source / functions) Coverage Total Hit
Test: Code coverage Lines: 0.0 % 92 0
Test Date: 2026-01-26 10:56:24 Functions: 0.0 % 2 0
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 0.0 % 26 0

             Branch data     Line data    Source code
       1                 :             : /*-------------------------------------------------------------------------
       2                 :             :  *
       3                 :             :  * hashdesc.c
       4                 :             :  *        rmgr descriptor routines for access/hash/hash.c
       5                 :             :  *
       6                 :             :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
       7                 :             :  * Portions Copyright (c) 1994, Regents of the University of California
       8                 :             :  *
       9                 :             :  *
      10                 :             :  * IDENTIFICATION
      11                 :             :  *        src/backend/access/rmgrdesc/hashdesc.c
      12                 :             :  *
      13                 :             :  *-------------------------------------------------------------------------
      14                 :             :  */
      15                 :             : #include "postgres.h"
      16                 :             : 
      17                 :             : #include "access/hash_xlog.h"
      18                 :             : 
      19                 :             : void
      20                 :           0 : hash_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_HASH_INIT_META_PAGE:
      28                 :             :                         {
      29                 :           0 :                                 xl_hash_init_meta_page *xlrec = (xl_hash_init_meta_page *) rec;
      30                 :             : 
      31                 :           0 :                                 appendStringInfo(buf, "num_tuples %g, procid %u, fillfactor %d",
      32                 :           0 :                                                                  xlrec->num_tuples,
      33                 :           0 :                                                                  xlrec->procid,
      34                 :           0 :                                                                  xlrec->ffactor);
      35                 :             :                                 break;
      36                 :           0 :                         }
      37                 :             :                 case XLOG_HASH_INIT_BITMAP_PAGE:
      38                 :             :                         {
      39                 :           0 :                                 xl_hash_init_bitmap_page *xlrec = (xl_hash_init_bitmap_page *) rec;
      40                 :             : 
      41                 :           0 :                                 appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
      42                 :             :                                 break;
      43                 :           0 :                         }
      44                 :             :                 case XLOG_HASH_INSERT:
      45                 :             :                         {
      46                 :           0 :                                 xl_hash_insert *xlrec = (xl_hash_insert *) rec;
      47                 :             : 
      48                 :           0 :                                 appendStringInfo(buf, "off %u", xlrec->offnum);
      49                 :             :                                 break;
      50                 :           0 :                         }
      51                 :             :                 case XLOG_HASH_ADD_OVFL_PAGE:
      52                 :             :                         {
      53                 :           0 :                                 xl_hash_add_ovfl_page *xlrec = (xl_hash_add_ovfl_page *) rec;
      54                 :             : 
      55                 :           0 :                                 appendStringInfo(buf, "bmsize %d, bmpage_found %c",
      56                 :           0 :                                                                  xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
      57                 :             :                                 break;
      58                 :           0 :                         }
      59                 :             :                 case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
      60                 :             :                         {
      61                 :           0 :                                 xl_hash_split_allocate_page *xlrec = (xl_hash_split_allocate_page *) rec;
      62                 :             : 
      63                 :           0 :                                 appendStringInfo(buf, "new_bucket %u, old_bucket_flag %u, new_bucket_flag %u, meta_page_masks_updated %c, issplitpoint_changed %c",
      64                 :           0 :                                                                  xlrec->new_bucket,
      65                 :           0 :                                                                  xlrec->old_bucket_flag,
      66                 :           0 :                                                                  xlrec->new_bucket_flag,
      67                 :           0 :                                                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
      68                 :           0 :                                                                  (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
      69                 :             :                                 break;
      70                 :           0 :                         }
      71                 :             :                 case XLOG_HASH_SPLIT_COMPLETE:
      72                 :             :                         {
      73                 :           0 :                                 xl_hash_split_complete *xlrec = (xl_hash_split_complete *) rec;
      74                 :             : 
      75                 :           0 :                                 appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
      76                 :           0 :                                                                  xlrec->old_bucket_flag, xlrec->new_bucket_flag);
      77                 :             :                                 break;
      78                 :           0 :                         }
      79                 :             :                 case XLOG_HASH_MOVE_PAGE_CONTENTS:
      80                 :             :                         {
      81                 :           0 :                                 xl_hash_move_page_contents *xlrec = (xl_hash_move_page_contents *) rec;
      82                 :             : 
      83                 :           0 :                                 appendStringInfo(buf, "ntups %d, is_primary %c",
      84                 :           0 :                                                                  xlrec->ntups,
      85                 :           0 :                                                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
      86                 :             :                                 break;
      87                 :           0 :                         }
      88                 :             :                 case XLOG_HASH_SQUEEZE_PAGE:
      89                 :             :                         {
      90                 :           0 :                                 xl_hash_squeeze_page *xlrec = (xl_hash_squeeze_page *) rec;
      91                 :             : 
      92                 :           0 :                                 appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c, is_previous %c",
      93                 :           0 :                                                                  xlrec->prevblkno,
      94                 :           0 :                                                                  xlrec->nextblkno,
      95                 :           0 :                                                                  xlrec->ntups,
      96                 :           0 :                                                                  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F',
      97                 :           0 :                                                                  xlrec->is_prev_bucket_same_wrt ? 'T' : 'F');
      98                 :             :                                 break;
      99                 :           0 :                         }
     100                 :             :                 case XLOG_HASH_DELETE:
     101                 :             :                         {
     102                 :           0 :                                 xl_hash_delete *xlrec = (xl_hash_delete *) rec;
     103                 :             : 
     104                 :           0 :                                 appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
     105                 :           0 :                                                                  xlrec->clear_dead_marking ? 'T' : 'F',
     106                 :           0 :                                                                  xlrec->is_primary_bucket_page ? 'T' : 'F');
     107                 :             :                                 break;
     108                 :           0 :                         }
     109                 :             :                 case XLOG_HASH_UPDATE_META_PAGE:
     110                 :             :                         {
     111                 :           0 :                                 xl_hash_update_meta_page *xlrec = (xl_hash_update_meta_page *) rec;
     112                 :             : 
     113                 :           0 :                                 appendStringInfo(buf, "ntuples %g",
     114                 :           0 :                                                                  xlrec->ntuples);
     115                 :             :                                 break;
     116                 :           0 :                         }
     117                 :             :                 case XLOG_HASH_VACUUM_ONE_PAGE:
     118                 :             :                         {
     119                 :           0 :                                 xl_hash_vacuum_one_page *xlrec = (xl_hash_vacuum_one_page *) rec;
     120                 :             : 
     121                 :           0 :                                 appendStringInfo(buf, "ntuples %d, snapshotConflictHorizon %u, isCatalogRel %c",
     122                 :           0 :                                                                  xlrec->ntuples,
     123                 :           0 :                                                                  xlrec->snapshotConflictHorizon,
     124                 :           0 :                                                                  xlrec->isCatalogRel ? 'T' : 'F');
     125                 :             :                                 break;
     126                 :           0 :                         }
     127                 :             :         }
     128                 :           0 : }
     129                 :             : 
     130                 :             : const char *
     131                 :           0 : hash_identify(uint8 info)
     132                 :             : {
     133                 :           0 :         const char *id = NULL;
     134                 :             : 
     135   [ #  #  #  #  :           0 :         switch (info & ~XLR_INFO_MASK)
          #  #  #  #  #  
             #  #  #  #  
                      # ]
     136                 :             :         {
     137                 :             :                 case XLOG_HASH_INIT_META_PAGE:
     138                 :           0 :                         id = "INIT_META_PAGE";
     139                 :           0 :                         break;
     140                 :             :                 case XLOG_HASH_INIT_BITMAP_PAGE:
     141                 :           0 :                         id = "INIT_BITMAP_PAGE";
     142                 :           0 :                         break;
     143                 :             :                 case XLOG_HASH_INSERT:
     144                 :           0 :                         id = "INSERT";
     145                 :           0 :                         break;
     146                 :             :                 case XLOG_HASH_ADD_OVFL_PAGE:
     147                 :           0 :                         id = "ADD_OVFL_PAGE";
     148                 :           0 :                         break;
     149                 :             :                 case XLOG_HASH_SPLIT_ALLOCATE_PAGE:
     150                 :           0 :                         id = "SPLIT_ALLOCATE_PAGE";
     151                 :           0 :                         break;
     152                 :             :                 case XLOG_HASH_SPLIT_PAGE:
     153                 :           0 :                         id = "SPLIT_PAGE";
     154                 :           0 :                         break;
     155                 :             :                 case XLOG_HASH_SPLIT_COMPLETE:
     156                 :           0 :                         id = "SPLIT_COMPLETE";
     157                 :           0 :                         break;
     158                 :             :                 case XLOG_HASH_MOVE_PAGE_CONTENTS:
     159                 :           0 :                         id = "MOVE_PAGE_CONTENTS";
     160                 :           0 :                         break;
     161                 :             :                 case XLOG_HASH_SQUEEZE_PAGE:
     162                 :           0 :                         id = "SQUEEZE_PAGE";
     163                 :           0 :                         break;
     164                 :             :                 case XLOG_HASH_DELETE:
     165                 :           0 :                         id = "DELETE";
     166                 :           0 :                         break;
     167                 :             :                 case XLOG_HASH_SPLIT_CLEANUP:
     168                 :           0 :                         id = "SPLIT_CLEANUP";
     169                 :           0 :                         break;
     170                 :             :                 case XLOG_HASH_UPDATE_META_PAGE:
     171                 :           0 :                         id = "UPDATE_META_PAGE";
     172                 :           0 :                         break;
     173                 :             :                 case XLOG_HASH_VACUUM_ONE_PAGE:
     174                 :           0 :                         id = "VACUUM_ONE_PAGE";
     175                 :           0 :         }
     176                 :             : 
     177                 :           0 :         return id;
     178                 :           0 : }
        

Generated by: LCOV version 2.3.2-1