|
7 | 7 | * |
8 | 8 | * |
9 | 9 | * 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 $ |
11 | 11 | * |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
@@ -197,8 +197,12 @@ _bt_moveright(Relation rel, |
197 | 197 | * if number of attrs > keysize. Example: (2,0) - last items |
198 | 198 | * on this page, (2,1) - first item on next page (hikey), our |
199 | 199 | * 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 |
202 | 206 | */ |
203 | 207 |
|
204 | 208 | if (_bt_skeycmp(rel, keysz, scankey, page, hikey, |
@@ -227,6 +231,8 @@ _bt_moveright(Relation rel, |
227 | 231 | elog(FATAL, "btree: unexpected greater last item"); |
228 | 232 | /* move right */ |
229 | 233 | } |
| 234 | + else if (!(opaque->btpo_flags & BTP_LEAF)) |
| 235 | + break; |
230 | 236 | else if (_bt_skeycmp(rel, keysz, scankey, page, |
231 | 237 | PageGetItemId(page, offmax), |
232 | 238 | BTLessEqualStrategyNumber)) |
|
0 commit comments