mirror of
https://github.com/postgres/postgres.git
synced 2025-05-18 17:41:14 +03:00
Don't crash when a rowtype argument to a plpgsql function is NULL.
Per report from Chris Campbell.
This commit is contained in:
parent
6b534f3c33
commit
bce5fd63fd
@ -3,7 +3,7 @@
|
|||||||
* procedural language
|
* procedural language
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.93 2003/10/01 21:47:42 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.93.2.1 2004/02/24 01:44:47 tgl Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@ -262,11 +262,19 @@ plpgsql_exec_function(PLpgSQL_function * func, FunctionCallInfo fcinfo)
|
|||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
TupleDesc tupdesc;
|
TupleDesc tupdesc;
|
||||||
|
|
||||||
Assert(slot != NULL && !fcinfo->argnull[i]);
|
if (!fcinfo->argnull[i])
|
||||||
|
{
|
||||||
|
Assert(slot != NULL);
|
||||||
tup = slot->val;
|
tup = slot->val;
|
||||||
tupdesc = slot->ttc_tupleDescriptor;
|
tupdesc = slot->ttc_tupleDescriptor;
|
||||||
exec_move_row(&estate, NULL, row, tup, tupdesc);
|
exec_move_row(&estate, NULL, row, tup, tupdesc);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* If arg is null, treat it as an empty row */
|
||||||
|
exec_move_row(&estate, NULL, row, NULL, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user