@@ -48,7 +48,7 @@ static void _SPI_fetch(FetchStmt * stmt);
4848#endif
4949static int
5050_SPI_execute_plan (_SPI_plan * plan ,
51- char * * Values ,char * Nulls ,int tcount );
51+ Datum * Values ,char * Nulls ,int tcount );
5252
5353#define _SPI_CPLAN_CURCXT 0
5454#define _SPI_CPLAN_PROCXT 1
@@ -199,7 +199,7 @@ SPI_exec(char *src, int tcount)
199199}
200200
201201int
202- SPI_execp (void * plan ,char * * Values ,char * Nulls ,int tcount )
202+ SPI_execp (void * plan ,Datum * Values ,char * Nulls ,int tcount )
203203{
204204int res ;
205205
282282SPI_fnumber (TupleDesc tupdesc ,char * fname )
283283{
284284int res ;
285-
286- if (_SPI_curid + 1 != _SPI_connected )
287- return (SPI_ERROR_UNCONNECTED );
288-
285+
289286for (res = 0 ;res < tupdesc -> natts ;res ++ )
290287{
291288if (strcasecmp (tupdesc -> attrs [res ]-> attname .data ,fname )== 0 )
@@ -300,20 +297,13 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
300297{
301298
302299SPI_result = 0 ;
303- if (_SPI_curid + 1 != _SPI_connected )
304- {
305- SPI_result = SPI_ERROR_UNCONNECTED ;
306- return (NULL );
307- }
308-
309300if (tupdesc -> natts < fnumber || fnumber <=0 )
310301{
311302SPI_result = SPI_ERROR_NOATTRIBUTE ;
312303return (NULL );
313304}
314305
315306return (nameout (& (tupdesc -> attrs [fnumber - 1 ]-> attname )));
316-
317307}
318308
319309char *
@@ -324,12 +314,6 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
324314Oid foutoid ;
325315
326316SPI_result = 0 ;
327- if (_SPI_curid + 1 != _SPI_connected )
328- {
329- SPI_result = SPI_ERROR_UNCONNECTED ;
330- return (NULL );
331- }
332-
333317if (tuple -> t_natts < fnumber || fnumber <=0 )
334318return (NULL );
335319
@@ -353,12 +337,6 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
353337
354338* isnull = true;
355339SPI_result = 0 ;
356- if (_SPI_curid + 1 != _SPI_connected )
357- {
358- SPI_result = SPI_ERROR_UNCONNECTED ;
359- return (NULL );
360- }
361-
362340if (tuple -> t_natts < fnumber || fnumber <=0 )
363341return (NULL );
364342
@@ -373,12 +351,6 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
373351HeapTuple typeTuple ;
374352
375353SPI_result = 0 ;
376- if (_SPI_curid + 1 != _SPI_connected )
377- {
378- SPI_result = SPI_ERROR_UNCONNECTED ;
379- return (NULL );
380- }
381-
382354if (tupdesc -> natts < fnumber || fnumber <=0 )
383355{
384356SPI_result = SPI_ERROR_NOATTRIBUTE ;
@@ -403,12 +375,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
403375{
404376
405377SPI_result = 0 ;
406- if (_SPI_curid + 1 != _SPI_connected )
407- {
408- SPI_result = SPI_ERROR_UNCONNECTED ;
409- return (InvalidOid );
410- }
411-
412378if (tupdesc -> natts < fnumber || fnumber <=0 )
413379{
414380SPI_result = SPI_ERROR_NOATTRIBUTE ;
@@ -421,14 +387,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
421387char *
422388SPI_getrelname (Relation rel )
423389{
424-
425- SPI_result = 0 ;
426- if (_SPI_curid + 1 != _SPI_connected )
427- {
428- SPI_result = SPI_ERROR_UNCONNECTED ;
429- return (NULL );
430- }
431-
432390return (pstrdup (rel -> rd_rel -> relname .data ));
433391}
434392
@@ -581,7 +539,7 @@ _SPI_execute(char *src, int tcount, _SPI_plan * plan)
581539}
582540
583541static int
584- _SPI_execute_plan (_SPI_plan * plan ,char * * Values ,char * Nulls ,int tcount )
542+ _SPI_execute_plan (_SPI_plan * plan ,Datum * Values ,char * Nulls ,int tcount )
585543{
586544QueryTreeList * queryTree_list = plan -> qtlist ;
587545List * planTree_list = plan -> ptlist ;
@@ -634,7 +592,7 @@ _SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
634592paramLI -> kind = PARAM_NUM ;
635593paramLI -> id = k + 1 ;
636594paramLI -> isnull = (Nulls != NULL && Nulls [k ]!= 'n' );
637- paramLI -> value = ( Datum ) Values [k ];
595+ paramLI -> value = Values [k ];
638596}
639597paramLI -> kind = PARAM_INVALID ;
640598}