aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-04-30 06:31:16 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-04-30 06:31:16 +0000
commitfe91ceb62b10afb84f60c4c482ba2600775ee180 (patch)
treeda1df6f75a400ea7f768d9581bdf0c25d485c2a9 /src
parent3055eeff9379cae9204ab84d441aad9719338fc5 (diff)
downloadpostgresql-fe91ceb62b10afb84f60c4c482ba2600775ee180.tar.gz
postgresql-fe91ceb62b10afb84f60c4c482ba2600775ee180.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/hash/hashsearch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c
index 459fbc3a167..f1450e1c1ca 100644
--- a/src/backend/access/hash/hashsearch.c
+++ b/src/backend/access/hash/hashsearch.c
@@ -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)) {