diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 77e2cafb10..e3073e42ab 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.133.4.3 2007/08/15 19:16:12 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.133.4.4 2008/10/16 13:23:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -642,7 +642,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) SPI_result = 0; - if (fnumber > tuple->t_data->t_natts || fnumber == 0 || + if (fnumber > tupdesc->natts || fnumber == 0 || fnumber <= FirstLowInvalidHeapAttributeNumber) { SPI_result = SPI_ERROR_NOATTRIBUTE; @@ -692,7 +692,7 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull) { SPI_result = 0; - if (fnumber > tuple->t_data->t_natts || fnumber == 0 || + if (fnumber > tupdesc->natts || fnumber == 0 || fnumber <= FirstLowInvalidHeapAttributeNumber) { SPI_result = SPI_ERROR_NOATTRIBUTE;