Skip to content

Commit bd305f3

Browse files
committed
Fix multi-column index scans in internal pages.
1 parent 8f4559d commit bd305f3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/backend/access/nbtree/nbtsearch.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.26 1997/09/08 20:54:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.27 1997/10/22 19:02:52 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -197,8 +197,12 @@ _bt_moveright(Relation rel,
197197
* if number of attrs > keysize. Example: (2,0) - last items
198198
* on this page, (2,1) - first item on next page (hikey), our
199199
* scankey is x = 2. Scankey == (2,1) because of we compare
200-
* first attrs only, but we shouldn't to move right of here. -
201-
* vadim 04/15/97
200+
* first attrs only, but we shouldn't to move right of here.
201+
* - vadim 04/15/97
202+
*
203+
* Also, if this page is not LEAF one (and # of attrs > keysize)
204+
* then we can't move too.
205+
* - vadim 10/22/97
202206
*/
203207

204208
if (_bt_skeycmp(rel, keysz, scankey, page, hikey,
@@ -227,6 +231,8 @@ _bt_moveright(Relation rel,
227231
elog(FATAL, "btree: unexpected greater last item");
228232
/* move right */
229233
}
234+
else if (!(opaque->btpo_flags & BTP_LEAF))
235+
break;
230236
else if (_bt_skeycmp(rel, keysz, scankey, page,
231237
PageGetItemId(page, offmax),
232238
BTLessEqualStrategyNumber))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy