#endif
static int
_SPI_execute_plan(_SPI_plan * plan,
- char **Values, char *Nulls, int tcount);
+ Datum *Values, char *Nulls, int tcount);
#define _SPI_CPLAN_CURCXT 0
#define _SPI_CPLAN_PROCXT 1
}
int
-SPI_execp(void *plan, char **Values, char *Nulls, int tcount)
+SPI_execp(void *plan, Datum *Values, char *Nulls, int tcount)
{
int res;
SPI_fnumber(TupleDesc tupdesc, char *fname)
{
int res;
-
- if (_SPI_curid + 1 != _SPI_connected)
- return (SPI_ERROR_UNCONNECTED);
-
+
for (res = 0; res < tupdesc->natts; res++)
{
if (strcasecmp(tupdesc->attrs[res]->attname.data, fname) == 0)
{
SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (NULL);
- }
-
if (tupdesc->natts < fnumber || fnumber <= 0)
{
SPI_result = SPI_ERROR_NOATTRIBUTE;
}
return (nameout(&(tupdesc->attrs[fnumber - 1]->attname)));
-
}
char *
Oid foutoid;
SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (NULL);
- }
-
if (tuple->t_natts < fnumber || fnumber <= 0)
return (NULL);
*isnull = true;
SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (NULL);
- }
-
if (tuple->t_natts < fnumber || fnumber <= 0)
return (NULL);
HeapTuple typeTuple;
SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (NULL);
- }
-
if (tupdesc->natts < fnumber || fnumber <= 0)
{
SPI_result = SPI_ERROR_NOATTRIBUTE;
{
SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (InvalidOid);
- }
-
if (tupdesc->natts < fnumber || fnumber <= 0)
{
SPI_result = SPI_ERROR_NOATTRIBUTE;
char *
SPI_getrelname(Relation rel)
{
-
- SPI_result = 0;
- if (_SPI_curid + 1 != _SPI_connected)
- {
- SPI_result = SPI_ERROR_UNCONNECTED;
- return (NULL);
- }
-
return (pstrdup(rel->rd_rel->relname.data));
}
}
static int
-_SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
+_SPI_execute_plan(_SPI_plan * plan, Datum *Values, char *Nulls, int tcount)
{
QueryTreeList *queryTree_list = plan->qtlist;
List *planTree_list = plan->ptlist;
paramLI->kind = PARAM_NUM;
paramLI->id = k + 1;
paramLI->isnull = (Nulls != NULL && Nulls[k] != 'n');
- paramLI->value = (Datum) Values[k];
+ paramLI->value = Values[k];
}
paramLI->kind = PARAM_INVALID;
}