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

Commitf270a16

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 parent7f71c89 commitf270a16

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
@@ -1395,6 +1395,23 @@ gistSplit(Relation r,
13951395
inti;
13961396
SplitedPageLayout*res=NULL;
13971397

1398+
/* this should never recurse very deeply, but better safe than sorry */
1399+
check_stack_depth();
1400+
1401+
/* there's no point in splitting an empty page */
1402+
Assert(len>0);
1403+
1404+
/*
1405+
* If a single tuple doesn't fit on a page, no amount of splitting will
1406+
* help.
1407+
*/
1408+
if (len==1)
1409+
ereport(ERROR,
1410+
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1411+
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
1412+
IndexTupleSize(itup[0]),GiSTPageSize,
1413+
RelationGetRelationName(r))));
1414+
13981415
memset(v.spl_lisnull, TRUE,sizeof(bool)*giststate->tupdesc->natts);
13991416
memset(v.spl_risnull, TRUE,sizeof(bool)*giststate->tupdesc->natts);
14001417
gistSplitByKey(r,page,itup,len,giststate,&v,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp