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

Commitae4fc52

Browse files
Check for interrupts in pg_trgm word similarity
Calculating similarity between large strings can be timesconsumingand overrun configured statement timeouts. Check for interrupts inthe main loop to ensure query cancellation can be performed.Author: Robins Tharakan <tharakan@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CAEP4nAxvmfc_XWTz73bqXRhgjONi=1HaX4_NhsopA3L6UvnN1g@mail.gmail.com
1 parent519be09 commitae4fc52

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎contrib/pg_trgm/trgm_op.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include"catalog/pg_type.h"
99
#include"lib/qunique.h"
10+
#include"miscadmin.h"
1011
#include"trgm.h"
1112
#include"tsearch/ts_locale.h"
1213
#include"utils/lsyscache.h"
@@ -492,8 +493,12 @@ iterate_word_similarity(int *trg2indexes,
492493

493494
for (i=0;i<len2;i++)
494495
{
496+
inttrgindex;
497+
498+
CHECK_FOR_INTERRUPTS();
499+
495500
/* Get index of next trigram */
496-
inttrgindex=trg2indexes[i];
501+
trgindex=trg2indexes[i];
497502

498503
/* Update last position of this trigram */
499504
if (lower >=0||found[trgindex])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp