Re: Problems with the varlena patch in my module

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
Cc: "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with the varlena patch in my module
Date: 2007-04-07 01:08:34
Message-ID: 29989.1175908114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2007-04-07 02:00:29 Re: Eliminating unnecessary left joins
Previous Message Tzahi Fadida 2007-04-07 00:00:38 Problems with the varlena patch in my module