mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
Fix error indicator for SPI_getvalue() and SPI_getbinval()
This commit is contained in:
parent
51689ece82
commit
3f6381d7e7
1 changed files with 6 additions and 0 deletions
|
|
@ -414,7 +414,10 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
|
|||
|
||||
SPI_result = 0;
|
||||
if (tuple->t_natts < fnumber || fnumber <= 0)
|
||||
{
|
||||
SPI_result = SPI_ERROR_NOATTRIBUTE;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, &isnull);
|
||||
if (isnull)
|
||||
|
|
@ -437,7 +440,10 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
|
|||
*isnull = true;
|
||||
SPI_result = 0;
|
||||
if (tuple->t_natts < fnumber || fnumber <= 0)
|
||||
{
|
||||
SPI_result = SPI_ERROR_NOATTRIBUTE;
|
||||
return ((Datum) NULL);
|
||||
}
|
||||
|
||||
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, isnull);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue