Skip site navigation (1) Skip section navigation (2)

Re: BUG #5314: Error in nested composite types in plpgsql.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Oleg Serov <serovov(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5314: Error in nested composite types in plpgsql.
Date: 2010-02-11 18:58:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> 2010/2/10 Oleg Serov <serovov(at)gmail(dot)com>:
>> Somebody will fix this bug or not?

> I'm not sure whether this is a bug.

Yeah, I think it is.  The problem is that exec_move_row is taking too
many shortcuts with nulls.  If the input record is short of fields it
is willing to pass this data to exec_assign_value:

				value = (Datum) 0;
				isnull = true;
				valtype = InvalidOid;

The invalid datatype value doesn't matter in the scalar case, but
if the target is a sub-row it fails the type_is_rowtype() sanity
check in exec_assign_value.

The cleanest fix would probably be to use the target variable's
datatype here instead of InvalidOid.  Alternatively, we could
change exec_assign_value to not apply the sanity check unless
the input is non-null.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Robert HaasDate: 2010-02-11 20:02:05
Subject: Re: BUG #5323: plperl and plperlu interaction segfaults
Previous:From: Dave OlszewskiDate: 2010-02-11 18:44:03
Subject: BUG #5323: plperl and plperlu interaction segfaults

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group