Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55d015b

Browse files
Add _bt_binsrch() scantid assertion to nbtree.
Assert that _bt_binsrch() binary searches with scantid set in insertionscankey cannot be performed on leaf pages. Leaf-level binary searcheswhere scantid is set must use _bt_binsrch_insert() instead._bt_binsrch_insert() is likely to have additional responsibilities inthe future, such as searching within GIN-style posting lists usingscantid. It seems like a good idea to tighten things up now.
1 parent3146f52 commit55d015b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/backend/access/nbtree/nbtsearch.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,14 @@ _bt_binsrch(Relation rel,
347347
int32result,
348348
cmpval;
349349

350-
/* Requesting nextkey semantics while using scantid seems nonsensical */
351-
Assert(!key->nextkey||key->scantid==NULL);
352-
353350
page=BufferGetPage(buf);
354351
opaque= (BTPageOpaque)PageGetSpecialPointer(page);
355352

353+
/* Requesting nextkey semantics while using scantid seems nonsensical */
354+
Assert(!key->nextkey||key->scantid==NULL);
355+
/* scantid-set callers must use _bt_binsrch_insert() on leaf pages */
356+
Assert(!P_ISLEAF(opaque)||key->scantid==NULL);
357+
356358
low=P_FIRSTDATAKEY(opaque);
357359
high=PageGetMaxOffsetNumber(page);
358360

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp