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

Commit0f08df4

Browse files
Avoid treating nonrequired nbtree keys as required.
Consistently prevent nbtree array advancement from treating a scankey asrequired when operating in pstate.forcenonrequired mode. Otherwise, werisk a NULL pointer dereference. This was possible in the path where_bt_check_compare is called to recheck a tuple that advanced all of thescan's arrays to matching values: its continuescan=false handlingexpects _bt_advance_array_keys to have been called with a valid pstate,but it'll always be NULL during sktrig_required=false calls (which ishow _bt_advance_array_keys must be called when pstate.forcenonrequired).Oversight in commit8a51027, which optimized nbtree search scan keycomparisons.Author: Peter Geoghegan <pg@bowt.ie>Reported-By: Mark Dilger <mark.dilger@enterprisedb.com>Discussion:https://postgr.es/m/CAHgHdKsn2W=gPBmj7p6MjQFvxB+zZDBkwTSg0o3f5Hh8rkRrsA@mail.gmail.comDiscussion:https://postgr.es/m/CAH2-WzmodSE+gpTd1CRGU9ez8ytyyDS+Kns2r9NzgUp1s56kpw@mail.gmail.com
1 parent1681a70 commit0f08df4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ _bt_advance_array_keys(IndexScanDesc scan, BTReadPageState *pstate,
18261826

18271827
/* Recheck _bt_check_compare on behalf of caller */
18281828
if (_bt_check_compare(scan,dir,tuple,tupnatts,tupdesc, false,
1829-
false,&continuescan,
1829+
!sktrig_required,&continuescan,
18301830
&nsktrig)&&
18311831
!so->scanBehind)
18321832
{
@@ -2799,8 +2799,6 @@ _bt_check_compare(IndexScanDesc scan, ScanDirection dir,
27992799
{
28002800
BTScanOpaqueso= (BTScanOpaque)scan->opaque;
28012801

2802-
Assert(!forcenonrequired||advancenonrequired);
2803-
28042802
*continuescan= true;/* default assumption */
28052803

28062804
for (;*ikey<so->numberOfKeys; (*ikey)++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp