Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6929a1e

Browse files
committed
Improve comment: add note that grotty special case in mdread() is
required by hash index implementation.
1 parent 90a06db commit 6929a1e

File tree

1 file changed

+7
-3
lines changed
  • src/backend/storage/smgr

1 file changed

+7
-3
lines changed

src/backend/storage/smgr/md.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.92 2002/08/06 02:36:34 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.93 2002/11/12 15:26:30 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -434,8 +434,12 @@ mdread(Relation reln, BlockNumber blocknum, char *buffer)
434434
if ((nbytes = FileRead(v->mdfd_vfd, buffer, BLCKSZ)) != BLCKSZ)
435435
{
436436
/*
437-
* If we are at EOF, return zeroes without complaining. (XXX Is
438-
* this still necessary/a good idea??)
437+
* If we are at or past EOF, return zeroes without complaining.
438+
* Also substitute zeroes if we found a partial block at EOF.
439+
*
440+
* XXX this is really ugly, bad design. However the current
441+
* implementation of hash indexes requires it, because hash index
442+
* pages are initialized out-of-order.
439443
*/
440444
if (nbytes == 0 ||
441445
(nbytes > 0 && mdnblocks(reln) == blocknum))

0 commit comments

Comments
 (0)