Skip to content

Commit f7807f1

Browse files
committed
Add check of headline method presence. Per report by Yoshiyuki Asaba <y-asaba@sraoss.co.jp>
1 parent dbdc2e5 commit f7807f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/backend/tsearch/wparser.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/wparser.c,v 1.6 2008/01/01 19:45:52 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/wparser.c,v 1.7 2008/01/15 17:16:01 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -309,6 +309,11 @@ ts_headline_byid_opt(PG_FUNCTION_ARGS)
309309
cfg = lookup_ts_config_cache(PG_GETARG_OID(0));
310310
prsobj = lookup_ts_parser_cache(cfg->prsId);
311311

312+
if ( !OidIsValid( prsobj->headlineOid ) )
313+
ereport(ERROR,
314+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
315+
errmsg("Text parser doesn't support headline creation")));
316+
312317
memset(&prs, 0, sizeof(HeadlineParsedText));
313318
prs.lenwords = 32;
314319
prs.words = (HeadlineWordEntry *) palloc(sizeof(HeadlineWordEntry) * prs.lenwords);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy