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

Commite42b3c3

Browse files
Fix GiST index deletion assert issue.
Avoid calling heap_index_delete_tuples() with an empty deltids array toavoid an assertion failure.This issue was arguably an oversight in commitb5f58cf, though thefailing assert itself was added by my recent commitd168b66. Nobackpatch, though, since the oversight is harmless in the back branches.Author: Peter Geoghegan <pg@bowt.ie>Reported-By: Jaime Casanova <jcasanov@systemguards.com.ec>Discussion:https://postgr.es/m/CAJKUy5jscES84n3puE=sYngyF+zpb4wv8UMtuLnLPv5z=6yyNw@mail.gmail.com
1 parent32bef75 commite42b3c3

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,6 @@ gistprunepage(Relation rel, Page page, Buffer buffer, Relation heapRel)
16451645
intndeletable=0;
16461646
OffsetNumberoffnum,
16471647
maxoff;
1648-
TransactionIdlatestRemovedXid=InvalidTransactionId;
16491648

16501649
Assert(GistPageIsLeaf(page));
16511650

@@ -1664,13 +1663,15 @@ gistprunepage(Relation rel, Page page, Buffer buffer, Relation heapRel)
16641663
deletable[ndeletable++]=offnum;
16651664
}
16661665

1667-
if (XLogStandbyInfoActive()&&RelationNeedsWAL(rel))
1668-
latestRemovedXid=
1669-
index_compute_xid_horizon_for_tuples(rel,heapRel,buffer,
1670-
deletable,ndeletable);
1671-
16721666
if (ndeletable>0)
16731667
{
1668+
TransactionIdlatestRemovedXid=InvalidTransactionId;
1669+
1670+
if (XLogStandbyInfoActive()&&RelationNeedsWAL(rel))
1671+
latestRemovedXid=
1672+
index_compute_xid_horizon_for_tuples(rel,heapRel,buffer,
1673+
deletable,ndeletable);
1674+
16741675
START_CRIT_SECTION();
16751676

16761677
PageIndexMultiDelete(page,deletable,ndeletable);

‎src/backend/access/index/genam.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ index_compute_xid_horizon_for_tuples(Relation irel,
301301
Pageipage=BufferGetPage(ibuf);
302302
IndexTupleitup;
303303

304+
Assert(nitems>0);
305+
304306
delstate.bottomup= false;
305307
delstate.bottomupfreespace=0;
306308
delstate.ndeltids=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp