mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
pageinspect: Support hash indexes.
Patch by Jesper Pedersen and Ashutosh Sharma, with some error handling improvements by me. Tests from Peter Eisentraut. Reviewed by Álvaro Herrera, Michael Paquier, Jesper Pedersen, Jeff Janes, Peter Eisentraut, Amit Kapila, Mithun Cy, and me. Discussion: http://postgr.es/m/e2ac6c58-b93f-9dd9-f4e6-d6d30add7fdf@redhat.com
This commit is contained in:
@@ -52,10 +52,12 @@ bitno_to_blkno(HashMetaPage metap, uint32 ovflbitnum)
|
||||
}
|
||||
|
||||
/*
|
||||
* _hash_ovflblkno_to_bitno
|
||||
*
|
||||
* Convert overflow page block number to bit number for free-page bitmap.
|
||||
*/
|
||||
static uint32
|
||||
blkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno)
|
||||
uint32
|
||||
_hash_ovflblkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno)
|
||||
{
|
||||
uint32 splitnum = metap->hashm_ovflpoint;
|
||||
uint32 i;
|
||||
@@ -485,7 +487,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf, Buffer wbuf,
|
||||
metap = HashPageGetMeta(BufferGetPage(metabuf));
|
||||
|
||||
/* Identify which bit to set */
|
||||
ovflbitno = blkno_to_bitno(metap, ovflblkno);
|
||||
ovflbitno = _hash_ovflblkno_to_bitno(metap, ovflblkno);
|
||||
|
||||
bitmappage = ovflbitno >> BMPG_SHIFT(metap);
|
||||
bitmapbit = ovflbitno & BMPG_MASK(metap);
|
||||
|
||||
Reference in New Issue
Block a user