aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/tsvector_op.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-11-21 17:07:07 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-11-21 17:07:07 -0500
commit1b9c04b1389b0e8ee7f493477c22c25f65a2f89a (patch)
tree8adcd4aef5d404d8dc99d522e20d9ced69406cfc /src/backend/utils/adt/tsvector_op.c
parent47a22dc2cb89aca2e54c9cf9fe2da4a5e8ba4cb4 (diff)
downloadpostgresql-1b9c04b1389b0e8ee7f493477c22c25f65a2f89a.tar.gz
postgresql-1b9c04b1389b0e8ee7f493477c22c25f65a2f89a.zip
Add comments and a missing CHECK_FOR_INTERRUPTS in ts_headline.
I just spent an annoying amount of time reverse-engineering the 100%-undocumented API between ts_headline and the text search parser's prsheadline function. Add some commentary about that while it's fresh in mind. Also remove some unused macros in wparser_def.c. While at it, I noticed that when commit 78e73e875 added a CHECK_FOR_INTERRUPTS call in TS_execute_recurse, it missed doing so in the parallel function TS_phrase_execute, which surely needs one just as much. Back-patch because of the missing CHECK_FOR_INTERRUPTS. Might as well back-patch the rest of this too.
Diffstat (limited to 'src/backend/utils/adt/tsvector_op.c')
-rw-r--r--src/backend/utils/adt/tsvector_op.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c
index 9236ebcc8fe..4237806d6d8 100644
--- a/src/backend/utils/adt/tsvector_op.c
+++ b/src/backend/utils/adt/tsvector_op.c
@@ -1616,6 +1616,9 @@ TS_phrase_execute(QueryItem *curitem, void *arg, uint32 flags,
/* since this function recurses, it could be driven to stack overflow */
check_stack_depth();
+ /* ... and let's check for query cancel while we're at it */
+ CHECK_FOR_INTERRUPTS();
+
if (curitem->type == QI_VAL)
return chkcond(arg, (QueryOperand *) curitem, data);