88 *
99 *
1010 * 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 $
1212 *
1313 * NOTES
1414 * This file contains only the public interface routines.
@@ -345,10 +345,9 @@ hashbeginscan(PG_FUNCTION_ARGS)
345345so = (HashScanOpaque )palloc (sizeof (HashScanOpaqueData ));
346346so -> hashso_bucket_valid = false;
347347so -> hashso_bucket_blkno = 0 ;
348- so -> hashso_curbuf = so -> hashso_mrkbuf = InvalidBuffer ;
349- /* setpositions invalid (this will cause _hash_first call) */
348+ so -> hashso_curbuf = InvalidBuffer ;
349+ /* setposition invalid (this will cause _hash_first call) */
350350ItemPointerSetInvalid (& (so -> hashso_curpos ));
351- ItemPointerSetInvalid (& (so -> hashso_mrkpos ));
352351
353352scan -> opaque = so ;
354353
@@ -372,23 +371,18 @@ hashrescan(PG_FUNCTION_ARGS)
372371/* if we are called from beginscan, so is still NULL */
373372if (so )
374373{
375- /* release anypins we still hold */
374+ /* release anypin we still hold */
376375if (BufferIsValid (so -> hashso_curbuf ))
377376_hash_dropbuf (rel ,so -> hashso_curbuf );
378377so -> hashso_curbuf = InvalidBuffer ;
379378
380- if (BufferIsValid (so -> hashso_mrkbuf ))
381- _hash_dropbuf (rel ,so -> hashso_mrkbuf );
382- so -> hashso_mrkbuf = InvalidBuffer ;
383-
384379/* release lock on bucket, too */
385380if (so -> hashso_bucket_blkno )
386381_hash_droplock (rel ,so -> hashso_bucket_blkno ,HASH_SHARE );
387382so -> hashso_bucket_blkno = 0 ;
388383
389- /* setpositions invalid (this will cause _hash_first call) */
384+ /* setposition invalid (this will cause _hash_first call) */
390385ItemPointerSetInvalid (& (so -> hashso_curpos ));
391- ItemPointerSetInvalid (& (so -> hashso_mrkpos ));
392386}
393387
394388/* Update scan key, if a new one is given */
@@ -417,15 +411,11 @@ hashendscan(PG_FUNCTION_ARGS)
417411/* don't need scan registered anymore */
418412_hash_dropscan (scan );
419413
420- /* release anypins we still hold */
414+ /* release anypin we still hold */
421415if (BufferIsValid (so -> hashso_curbuf ))
422416_hash_dropbuf (rel ,so -> hashso_curbuf );
423417so -> hashso_curbuf = InvalidBuffer ;
424418
425- if (BufferIsValid (so -> hashso_mrkbuf ))
426- _hash_dropbuf (rel ,so -> hashso_mrkbuf );
427- so -> hashso_mrkbuf = InvalidBuffer ;
428-
429419/* release lock on bucket, too */
430420if (so -> hashso_bucket_blkno )
431421_hash_droplock (rel ,so -> hashso_bucket_blkno ,HASH_SHARE );
@@ -443,24 +433,7 @@ hashendscan(PG_FUNCTION_ARGS)
443433Datum
444434hashmarkpos (PG_FUNCTION_ARGS )
445435{
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" );
464437PG_RETURN_VOID ();
465438}
466439
@@ -470,24 +443,7 @@ hashmarkpos(PG_FUNCTION_ARGS)
470443Datum
471444hashrestrpos (PG_FUNCTION_ARGS )
472445{
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" );
491447PG_RETURN_VOID ();
492448}
493449