Thursday, July 17, 2008

Re: [HACKERS] Re: [COMMITTERS] pgsql: Add column storage type to psql \d+ display.

Alvaro Herrera <alvherre@commandprompt.com> writes:
> Bruce Momjian wrote:
>> I don't see that warning with my compiler so I have no way of testing
>> this, but I do see this line pretty high in the function:
>> tableinfo.relkind = *(PQgetvalue(res, 0, 1));

> But it's before the first "goto error_return", after which it is checked.

Ah. That code is indeed broken, or at least risky in the extreme. What
the cleanup code ought to be checking is just whether or not the arrays
have gotten allocated yet. Checking a condition that should later lead
to the array getting allocated is just asking for trouble --- even if
there's not a "goto error_return" in between today, someday someone will
insert one.

Patch applied ...

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: