1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix up several contrib modules that were using varlena datatypes in not-so-obvious

ways.  I'm not totally sure that I caught everything, but at least now they pass
their regression tests with VARSIZE/SET_VARSIZE defined to reverse byte order.
This commit is contained in:
Tom Lane
2007-02-28 22:44:38 +00:00
parent d1ce4f7396
commit 9f652d430f
24 changed files with 152 additions and 147 deletions

View File

@ -70,9 +70,9 @@ generate_trgm(char *str, int slen)
int wl,
len;
trg = (TRGM *) palloc(TRGMHRDSIZE + sizeof(trgm) * (slen / 2 + 1) * 3);
trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) * 3);
trg->flag = ARRKEY;
trg->len = TRGMHRDSIZE;
SET_VARSIZE(trg, TRGMHDRSIZE);
if (slen + LPADDING + RPADDING < 3 || slen == 0)
return trg;
@ -178,7 +178,7 @@ generate_trgm(char *str, int slen)
len = unique_array(GETARR(trg), len);
}
trg->len = CALCGTSIZE(ARRKEY, len);
SET_VARSIZE(trg, CALCGTSIZE(ARRKEY, len));
return trg;
}