Fix coding error in UTF conversion.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 May 2002 21:04:34 +0000 (21:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 May 2002 21:04:34 +0000 (21:04 +0000)
src/pl/tcl/pltcl.c

index f477c7f22ca6d4d71a306b36dc3b132981d974d0..686a59f0039004e5ce4b37ec57f607da862d05be 100644 (file)
@@ -594,15 +594,17 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
        if (SPI_finish() != SPI_OK_FINISH)
                elog(ERROR, "pltcl: SPI_finish() failed");
 
-       UTF_BEGIN;
        if (fcinfo->isnull)
                retval = (Datum) 0;
        else
+       {
+               UTF_BEGIN;
                retval = FunctionCall3(&prodesc->result_in_func,
                                                           PointerGetDatum(UTF_U2E(interp->result)),
                                                           ObjectIdGetDatum(prodesc->result_in_elem),
                                                           Int32GetDatum(-1));
-       UTF_END;
+               UTF_END;
+       }
 
        /************************************************************
         * Finally we may restore normal error handling.