8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.105 2008/09/15 18:43:41 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.106 2008/10/17 23:50:57 tgl Exp $
12
12
*
13
13
* NOTES
14
14
* This file contains only the public interface routines.
@@ -345,10 +345,9 @@ hashbeginscan(PG_FUNCTION_ARGS)
345
345
so = (HashScanOpaque ) palloc (sizeof (HashScanOpaqueData ));
346
346
so -> hashso_bucket_valid = false;
347
347
so -> hashso_bucket_blkno = 0 ;
348
- so -> hashso_curbuf = so -> hashso_mrkbuf = InvalidBuffer ;
349
- /* set positions invalid (this will cause _hash_first call) */
348
+ so -> hashso_curbuf = InvalidBuffer ;
349
+ /* set position invalid (this will cause _hash_first call) */
350
350
ItemPointerSetInvalid (& (so -> hashso_curpos ));
351
- ItemPointerSetInvalid (& (so -> hashso_mrkpos ));
352
351
353
352
scan -> opaque = so ;
354
353
@@ -372,23 +371,18 @@ hashrescan(PG_FUNCTION_ARGS)
372
371
/* if we are called from beginscan, so is still NULL */
373
372
if (so )
374
373
{
375
- /* release any pins we still hold */
374
+ /* release any pin we still hold */
376
375
if (BufferIsValid (so -> hashso_curbuf ))
377
376
_hash_dropbuf (rel , so -> hashso_curbuf );
378
377
so -> hashso_curbuf = InvalidBuffer ;
379
378
380
- if (BufferIsValid (so -> hashso_mrkbuf ))
381
- _hash_dropbuf (rel , so -> hashso_mrkbuf );
382
- so -> hashso_mrkbuf = InvalidBuffer ;
383
-
384
379
/* release lock on bucket, too */
385
380
if (so -> hashso_bucket_blkno )
386
381
_hash_droplock (rel , so -> hashso_bucket_blkno , HASH_SHARE );
387
382
so -> hashso_bucket_blkno = 0 ;
388
383
389
- /* set positions invalid (this will cause _hash_first call) */
384
+ /* set position invalid (this will cause _hash_first call) */
390
385
ItemPointerSetInvalid (& (so -> hashso_curpos ));
391
- ItemPointerSetInvalid (& (so -> hashso_mrkpos ));
392
386
}
393
387
394
388
/* Update scan key, if a new one is given */
@@ -417,15 +411,11 @@ hashendscan(PG_FUNCTION_ARGS)
417
411
/* don't need scan registered anymore */
418
412
_hash_dropscan (scan );
419
413
420
- /* release any pins we still hold */
414
+ /* release any pin we still hold */
421
415
if (BufferIsValid (so -> hashso_curbuf ))
422
416
_hash_dropbuf (rel , so -> hashso_curbuf );
423
417
so -> hashso_curbuf = InvalidBuffer ;
424
418
425
- if (BufferIsValid (so -> hashso_mrkbuf ))
426
- _hash_dropbuf (rel , so -> hashso_mrkbuf );
427
- so -> hashso_mrkbuf = InvalidBuffer ;
428
-
429
419
/* release lock on bucket, too */
430
420
if (so -> hashso_bucket_blkno )
431
421
_hash_droplock (rel , so -> hashso_bucket_blkno , HASH_SHARE );
@@ -443,24 +433,7 @@ hashendscan(PG_FUNCTION_ARGS)
443
433
Datum
444
434
hashmarkpos (PG_FUNCTION_ARGS )
445
435
{
446
- IndexScanDesc scan = (IndexScanDesc ) PG_GETARG_POINTER (0 );
447
- HashScanOpaque so = (HashScanOpaque ) scan -> opaque ;
448
- Relation rel = scan -> indexRelation ;
449
-
450
- /* release pin on old marked data, if any */
451
- if (BufferIsValid (so -> hashso_mrkbuf ))
452
- _hash_dropbuf (rel , so -> hashso_mrkbuf );
453
- so -> hashso_mrkbuf = InvalidBuffer ;
454
- ItemPointerSetInvalid (& (so -> hashso_mrkpos ));
455
-
456
- /* bump pin count on current buffer and copy to marked buffer */
457
- if (ItemPointerIsValid (& (so -> hashso_curpos )))
458
- {
459
- IncrBufferRefCount (so -> hashso_curbuf );
460
- so -> hashso_mrkbuf = so -> hashso_curbuf ;
461
- so -> hashso_mrkpos = so -> hashso_curpos ;
462
- }
463
-
436
+ elog (ERROR , "hash does not support mark/restore" );
464
437
PG_RETURN_VOID ();
465
438
}
466
439
@@ -470,24 +443,7 @@ hashmarkpos(PG_FUNCTION_ARGS)
470
443
Datum
471
444
hashrestrpos (PG_FUNCTION_ARGS )
472
445
{
473
- IndexScanDesc scan = (IndexScanDesc ) PG_GETARG_POINTER (0 );
474
- HashScanOpaque so = (HashScanOpaque ) scan -> opaque ;
475
- Relation rel = scan -> indexRelation ;
476
-
477
- /* release pin on current data, if any */
478
- if (BufferIsValid (so -> hashso_curbuf ))
479
- _hash_dropbuf (rel , so -> hashso_curbuf );
480
- so -> hashso_curbuf = InvalidBuffer ;
481
- ItemPointerSetInvalid (& (so -> hashso_curpos ));
482
-
483
- /* bump pin count on marked buffer and copy to current buffer */
484
- if (ItemPointerIsValid (& (so -> hashso_mrkpos )))
485
- {
486
- IncrBufferRefCount (so -> hashso_mrkbuf );
487
- so -> hashso_curbuf = so -> hashso_mrkbuf ;
488
- so -> hashso_curpos = so -> hashso_mrkpos ;
489
- }
490
-
446
+ elog (ERROR , "hash does not support mark/restore" );
491
447
PG_RETURN_VOID ();
492
448
}
493
449
0 commit comments