diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 147284aa1e9..db2f3d0545d 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.127.4.7 2007/02/08 18:38:08 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.127.4.8 2010/02/12 19:38:15 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -2925,12 +2925,6 @@ exec_assign_value(PLpgSQL_execstate *estate, */ PLpgSQL_row *row = (PLpgSQL_row *) target; - /* Source must be of RECORD or composite type */ - if (!(valtype == RECORDOID || - get_typtype(valtype) == 'c')) - ereport(ERROR, - (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("cannot assign non-composite value to a row variable"))); if (*isNull) { /* If source is null, just assign nulls to the row */ @@ -2944,7 +2938,13 @@ exec_assign_value(PLpgSQL_execstate *estate, TupleDesc tupdesc; HeapTupleData tmptup; - /* Else source is a tuple Datum, safe to do this: */ + /* Source must be of RECORD or composite type */ + if (!(valtype == RECORDOID || + get_typtype(valtype) == 'c')) + ereport(ERROR, + (errcode(ERRCODE_DATATYPE_MISMATCH), + errmsg("cannot assign non-composite value to a row variable"))); + /* So source is a tuple Datum, safe to do this: */ td = DatumGetHeapTupleHeader(value); /* Extract rowtype info and find a tupdesc */ tupType = HeapTupleHeaderGetTypeId(td); @@ -2969,12 +2969,6 @@ exec_assign_value(PLpgSQL_execstate *estate, */ PLpgSQL_rec *rec = (PLpgSQL_rec *) target; - /* Source must be of RECORD or composite type */ - if (!(valtype == RECORDOID || - get_typtype(valtype) == 'c')) - ereport(ERROR, - (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("cannot assign non-composite value to a record variable"))); if (*isNull) { /* If source is null, just assign nulls to the record */ @@ -2988,7 +2982,13 @@ exec_assign_value(PLpgSQL_execstate *estate, TupleDesc tupdesc; HeapTupleData tmptup; - /* Else source is a tuple Datum, safe to do this: */ + /* Source must be of RECORD or composite type */ + if (!(valtype == RECORDOID || + get_typtype(valtype) == 'c')) + ereport(ERROR, + (errcode(ERRCODE_DATATYPE_MISMATCH), + errmsg("cannot assign non-composite value to a record variable"))); + /* So source is a tuple Datum, safe to do this: */ td = DatumGetHeapTupleHeader(value); /* Extract rowtype info and find a tupdesc */ tupType = HeapTupleHeaderGetTypeId(td); |