From: Teodor Sigaev Date: Mon, 2 Apr 2007 11:42:04 +0000 (+0000) Subject: Fix caching of unsuccessful initialization of parser or configuration. X-Git-Tag: REL8_3_BETA1~916 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9477f12ea8ead7d66e80c01febeeb22560bc1709;p=postgresql Fix caching of unsuccessful initialization of parser or configuration. Per report from Listmail --- 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!! */ ;