From 9477f12ea8ead7d66e80c01febeeb22560bc1709 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 2 Apr 2007 11:42:04 +0000 Subject: [PATCH] Fix caching of unsuccessful initialization of parser or configuration. Per report from Listmail --- contrib/tsearch2/ts_cfg.c | 2 +- contrib/tsearch2/wparser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/tsearch2/ts_cfg.c b/contrib/tsearch2/ts_cfg.c index d62d49a249..0dc17703c3 100644 --- a/contrib/tsearch2/ts_cfg.c +++ b/contrib/tsearch2/ts_cfg.c @@ -224,8 +224,8 @@ findcfg(Oid id) CList.reallen = reallen; CList.list = tmp; } + init_cfg(id, &(CList.list[CList.len]) ); CList.last_cfg = &(CList.list[CList.len]); - init_cfg(id, CList.last_cfg); CList.len++; qsort(CList.list, CList.len, sizeof(TSCfgInfo), comparecfg); return findcfg(id); /* qsort changed order!! */ ; diff --git a/contrib/tsearch2/wparser.c b/contrib/tsearch2/wparser.c index efe449451f..31148db62b 100644 --- a/contrib/tsearch2/wparser.c +++ b/contrib/tsearch2/wparser.c @@ -127,8 +127,8 @@ findprs(Oid id) PList.reallen = reallen; PList.list = tmp; } + init_prs(id, &(PList.list[PList.len]) ); PList.last_prs = &(PList.list[PList.len]); - init_prs(id, PList.last_prs); PList.len++; qsort(PList.list, PList.len, sizeof(WParserInfo), compareprs); return findprs(id); /* qsort changed order!! */ ; -- 2.40.0