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

Commit7690dde

Browse files
committed
Check for GiST index tuples that don't fit on a page.
The page splitting code would go into infinite recursion if you try toinsert an index tuple that doesn't fit even on an empty page.Per analysis and suggested fix by Andrew Gierth. Fixes bug #11555, reportedby Bryan Seitz (analysis happened over IRC). Backpatch to all supportedversions.
1 parent7a08e21 commit7690dde

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,23 @@ gistSplit(Relation r,
12641264
inti;
12651265
SplitedPageLayout*res=NULL;
12661266

1267+
/* this should never recurse very deeply, but better safe than sorry */
1268+
check_stack_depth();
1269+
1270+
/* there's no point in splitting an empty page */
1271+
Assert(len>0);
1272+
1273+
/*
1274+
* If a single tuple doesn't fit on a page, no amount of splitting will
1275+
* help.
1276+
*/
1277+
if (len==1)
1278+
ereport(ERROR,
1279+
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1280+
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
1281+
IndexTupleSize(itup[0]),GiSTPageSize,
1282+
RelationGetRelationName(r))));
1283+
12671284
memset(v.spl_lisnull, TRUE,sizeof(bool)*giststate->tupdesc->natts);
12681285
memset(v.spl_risnull, TRUE,sizeof(bool)*giststate->tupdesc->natts);
12691286
gistSplitByKey(r,page,itup,len,giststate,&v,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp