~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/pl/tcl/pltcl.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * pltcl.c              - PostgreSQL support for Tcl as
3
3
 *                                procedural language (PL)
4
4
 *
5
 
 *        $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.127 2009/01/21 11:13:14 heikki Exp $
 
5
 *        $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.128 2009/06/11 14:49:14 momjian Exp $
6
6
 *
7
7
 **********************************************************************/
8
8
 
672
672
        {
673
673
                UTF_BEGIN;
674
674
                retval = InputFunctionCall(&prodesc->result_in_func,
675
 
                                                                   UTF_U2E((char *) Tcl_GetStringResult(interp)),
 
675
                                                           UTF_U2E((char *) Tcl_GetStringResult(interp)),
676
676
                                                                   prodesc->result_typioparam,
677
677
                                                                   -1);
678
678
                UTF_END;
1009
1009
{
1010
1010
        /*
1011
1011
         * Caution is needed here because Tcl_GetVar could overwrite the
1012
 
         * interpreter result (even though it's not really supposed to),
1013
 
         * and we can't control the order of evaluation of ereport arguments.
1014
 
         * Hence, make real sure we have our own copy of the result string
1015
 
         * before invoking Tcl_GetVar.
 
1012
         * interpreter result (even though it's not really supposed to), and we
 
1013
         * can't control the order of evaluation of ereport arguments. Hence, make
 
1014
         * real sure we have our own copy of the result string before invoking
 
1015
         * Tcl_GetVar.
1016
1016
         */
1017
1017
        char       *emsg;
1018
1018
        char       *econtext;
1210
1210
                                free(prodesc);
1211
1211
                                ereport(ERROR,
1212
1212
                                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1213
 
                                                 errmsg("PL/Tcl functions cannot return composite types")));
 
1213
                                  errmsg("PL/Tcl functions cannot return composite types")));
1214
1214
                        }
1215
1215
 
1216
1216
                        perm_fmgr_info(typeStruct->typinput, &(prodesc->result_in_func));
1416
1416
        if (level == ERROR)
1417
1417
        {
1418
1418
                /*
1419
 
                 * We just pass the error back to Tcl.  If it's not caught,
1420
 
                 * it'll eventually get converted to a PG error when we reach
1421
 
                 * the call handler.
 
1419
                 * We just pass the error back to Tcl.  If it's not caught, it'll
 
1420
                 * eventually get converted to a PG error when we reach the call
 
1421
                 * handler.
1422
1422
                 */
1423
1423
                Tcl_SetResult(interp, (char *) argv[2], TCL_VOLATILE);
1424
1424
                return TCL_ERROR;
1425
1425
        }
1426
1426
 
1427
1427
        /*
1428
 
         * For non-error messages, just pass 'em to elog().  We do not expect
1429
 
         * that this will fail, but just on the off chance it does, report the
1430
 
         * error back to Tcl.  Note we are assuming that elog() can't have any
1431
 
         * internal failures that are so bad as to require a transaction abort.
 
1428
         * For non-error messages, just pass 'em to elog().  We do not expect that
 
1429
         * this will fail, but just on the off chance it does, report the error
 
1430
         * back to Tcl.  Note we are assuming that elog() can't have any internal
 
1431
         * failures that are so bad as to require a transaction abort.
1432
1432
         *
1433
1433
         * This path is also used for FATAL errors, which aren't going to come
1434
1434
         * back to us at all.