mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix old bug in _hash_first() for scan without keys:
if 1st bucket chain is empty then need to continue scan in the rest buckets.
This commit is contained in:
		@@ -7,7 +7,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * IDENTIFICATION
 | 
			
		||||
 *    $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.8 1996/11/21 06:06:52 vadim Exp $
 | 
			
		||||
 *    $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.9 1997/04/30 06:31:16 vadim Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -221,7 +221,13 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
 | 
			
		||||
	} else {
 | 
			
		||||
	    ItemPointerSetInvalid(current);
 | 
			
		||||
	    so->hashso_curbuf = InvalidBuffer;
 | 
			
		||||
	    return ((RetrieveIndexResult) NULL);
 | 
			
		||||
	    /* 
 | 
			
		||||
	     * If there is no scankeys, all tuples will satisfy 
 | 
			
		||||
	     * the scan - so we continue in _hash_step to get 
 | 
			
		||||
	     * tuples from all buckets.	- vadim 04/29/97
 | 
			
		||||
	     */
 | 
			
		||||
	    if ( scan->numberOfKeys >= 1 )
 | 
			
		||||
	    	return ((RetrieveIndexResult) NULL);
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
    if (ScanDirectionIsBackward(dir)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user