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

Commitfade4d4

Browse files
committed
Back-patch addition of stack overflow and interrupt checks for lquery.
Experimentation shows that it's not hard at all to drive theold implementation of "ltree ~ lquery" match to stack overflow,so throw in a check_stack_depth() call, as I just did in HEAD.I wasn't able to make it take a long time, because all thepathological cases I tried hit stack overflow first; butI bet there are some others that do take a long time, so addCHECK_FOR_INTERRUPTS() too.Discussion:https://postgr.es/m/CAP_rww=waX2Oo6q+MbMSiZ9ktdj6eaJj0cQzNu=Ry2cCDij5fw@mail.gmail.com
1 parent4bc3a16 commitfade4d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎contrib/ltree/lquery_op.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include<ctype.h>
99

1010
#include"catalog/pg_collation.h"
11+
#include"miscadmin.h"
1112
#include"utils/formatting.h"
1213
#include"ltree.h"
1314

@@ -165,6 +166,12 @@ checkCond(lquery_level *curq, int query_numlevel, ltree_level *curt, int tree_nu
165166
lquery_level*prevq=NULL;
166167
ltree_level*prevt=NULL;
167168

169+
/* Since this function recurses, it could be driven to stack overflow */
170+
check_stack_depth();
171+
172+
/* Pathological patterns could take awhile, too */
173+
CHECK_FOR_INTERRUPTS();
174+
168175
if (SomeStack.muse)
169176
{
170177
high_pos=SomeStack.high_pos;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp