Skip to content

Commit baeab89

Browse files
committed
Fixes about word with several infiniteve
1 parent 9ea7388 commit baeab89

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

contrib/tsearch2/query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval, int2 we
278278
pushval_asis(state, VAL, prs.words[count].word, prs.words[count].len, weight);
279279
pfree(prs.words[count].word);
280280
if (count)
281-
pushquery(state, OPR, (int4) '&', 0, 0, 0);
281+
pushquery(state, OPR, (int4) '|', 0, 0, 0);
282282
}
283283
pfree(prs.words);
284284

contrib/tsearch2/tsvector.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,10 @@ uniqueWORD(WORD * a, int4 l)
635635
res->alen *= 2;
636636
res->pos.apos = (uint16 *) repalloc(res->pos.apos, sizeof(uint16) * res->alen);
637637
}
638-
res->pos.apos[res->pos.apos[0] + 1] = LIMITPOS(ptr->pos.pos);
639-
res->pos.apos[0]++;
638+
if ( res->pos.apos[0]==0 || res->pos.apos[res->pos.apos[0]] != LIMITPOS(ptr->pos.pos) ) {
639+
res->pos.apos[res->pos.apos[0] + 1] = LIMITPOS(ptr->pos.pos);
640+
res->pos.apos[0]++;
641+
}
640642
}
641643
}
642644
ptr++;

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