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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user