ret->status = PyInt_FromLong(SPI_OK_FETCH);
Py_DECREF(ret->nrows);
- ret->nrows = (SPI_processed > (uint64) LONG_MAX) ?
- PyFloat_FromDouble((double) SPI_processed) :
- PyInt_FromLong((long) SPI_processed);
+ ret->nrows = PyLong_FromUnsignedLongLong(SPI_processed);
if (SPI_processed != 0)
{
if (status > 0 && tuptable == NULL)
{
Py_DECREF(result->nrows);
- result->nrows = (rows > (uint64) LONG_MAX) ?
- PyFloat_FromDouble((double) rows) :
- PyInt_FromLong((long) rows);
+ result->nrows = PyLong_FromUnsignedLongLong(rows);
}
else if (status > 0 && tuptable != NULL)
{
MemoryContext cxt;
Py_DECREF(result->nrows);
- result->nrows = (rows > (uint64) LONG_MAX) ?
- PyFloat_FromDouble((double) rows) :
- PyInt_FromLong((long) rows);
+ result->nrows = PyLong_FromUnsignedLongLong(rows);
cxt = AllocSetContextCreate(CurrentMemoryContext,
"PL/Python temp context",