|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -434,8 +434,12 @@ mdread(Relation reln, BlockNumber blocknum, char *buffer)
|
434 | 434 | if ((nbytes=FileRead(v->mdfd_vfd,buffer,BLCKSZ))!=BLCKSZ)
|
435 | 435 | {
|
436 | 436 | /*
|
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. |
439 | 443 | */
|
440 | 444 | if (nbytes==0||
|
441 | 445 | (nbytes>0&&mdnblocks(reln)==blocknum))
|
|