mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Change
typedef struct {} WordEntryPos; to typedef uint16 WordEntryPos according to http://www.pgsql.ru/db/mw/msg.html?mid=2035188 Require re-fill all tsvector fields and reindex tsvector indexes.
This commit is contained in:
@ -106,7 +106,7 @@ setweight(PG_FUNCTION_ARGS)
|
||||
p = POSDATAPTR(out, entry);
|
||||
while (j--)
|
||||
{
|
||||
p->weight = w;
|
||||
WEP_SETWEIGHT(*p,w);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
@ -144,10 +144,10 @@ add_pos(tsvector * src, WordEntry * srcptr, tsvector * dest, WordEntry * destptr
|
||||
*clen = 0;
|
||||
|
||||
startlen = *clen;
|
||||
for (i = 0; i < slen && *clen < MAXNUMPOS && (*clen == 0 || dpos[*clen - 1].pos != MAXENTRYPOS - 1); i++)
|
||||
for (i = 0; i < slen && *clen < MAXNUMPOS && (*clen == 0 || WEP_GETPOS(dpos[*clen - 1]) != MAXENTRYPOS - 1); i++)
|
||||
{
|
||||
dpos[*clen].weight = spos[i].weight;
|
||||
dpos[*clen].pos = LIMITPOS(spos[i].pos + maxpos);
|
||||
WEP_SETWEIGHT(dpos[*clen], WEP_GETWEIGHT(spos[i]));
|
||||
WEP_SETPOS(dpos[*clen], LIMITPOS(WEP_GETPOS(spos[i]) + maxpos));
|
||||
(*clen)++;
|
||||
}
|
||||
|
||||
@ -186,8 +186,8 @@ concat(PG_FUNCTION_ARGS)
|
||||
p = POSDATAPTR(in1, ptr);
|
||||
while (j--)
|
||||
{
|
||||
if (p->pos > maxpos)
|
||||
maxpos = p->pos;
|
||||
if (WEP_GETPOS(*p) > maxpos)
|
||||
maxpos = WEP_GETPOS(*p);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user