Re: Problems with the varlena patch in my module - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Problems with the varlena patch in my module
Date
Msg-id 29989.1175908114@sss.pgh.pa.us
Whole thread Raw
In response to Problems with the varlena patch in my module  (Tzahi Fadida <Tzahi.ML@gmail.com>)
Responses Re: Problems with the varlena patch in my module  (Tzahi Fadida <Tzahi.ML@gmail.com>)
List pgsql-hackers
Tzahi Fadida <Tzahi.ML@gmail.com> writes:
> This is an excerpt from my code:
> newtset->tids = (bytea *) fastgetattr(tupleTSet, LABELS_ALIGNED, 
> fctx->tupleSetDesc, &isnull);

> It seems that for an empty bytea (only the size of the header), i get that 
> VARSIZE(newtset->tids)==534765440
> instead of VARHDRSZ.

That code has always been broken, you just failed to exercise the
problem before.  There needs to be a detoasting call there, not
merely a cast.  DatumGetByteaP() would probably be appropriate.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tzahi Fadida
Date:
Subject: Problems with the varlena patch in my module
Next
From: Andreas Pflug
Date:
Subject: Re: Eliminating unnecessary left joins