Re: Garbage pad bytes within datums are bad news

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Garbage pad bytes within datums are bad news
Date: 2008-04-04 22:57:01
Message-ID: 9617.1207349821@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> I suppose if all we want to do is assert that constructors don't create this
> situation we could have an assertion that calls the constructor a second time
> (with palloc generating garbage data) and compares the results with
> datumEqual.

After further reflection I think it might indeed be the case that we
only have to worry about the datatype input routines, since those are
what are invoked to create Consts that the user has a right to expect
are equal().

I cons'd up a quick hack along the above lines and ran the regression
tests with it. The failures suggest that aside from array_in, we'll
need to fix these types:
path
tsquery
lquery (in contrib)
ltree (in contrib)

That seems like a short enough list that the right fix for the back
branches is just to fix these input routines (palloc0 instead of palloc
should do it). I'm not sure yet if we want some less-klugy solution
for the future.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-04-04 23:00:14 Re: Separate psql commands from arguments
Previous Message Gregory Stark 2008-04-04 22:46:11 Re: Garbage pad bytes within datums are bad news