~aglenyoung/+junk/postgres-9.3-dtrace

« back to all changes in this revision

Viewing changes to src/pl/plpython/plpy_util.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, Christoph Berg, Martin Pitt
  • Date: 2013-06-26 15:13:32 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130626151332-p34yjpn0txbdsdzd
Tags: 9.3~beta2-1
[ Christoph Berg ]
* hurd-i386: Ignore testsuite failures so we have a working libpq5 (they
  don't implement semaphores so the server won't even start).
* Mark postgresql-9.3 as beta in the description, suggested by Joshua D.
  Drake.

[ Martin Pitt ]
* New upstream release 9.3 beta2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
PyObject *
62
62
PLyUnicode_Bytes(PyObject *unicode)
63
63
{
64
 
        PyObject        *bytes, *rv;
65
 
        char            *utf8string, *encoded;
 
64
        PyObject   *bytes,
 
65
                           *rv;
 
66
        char       *utf8string,
 
67
                           *encoded;
66
68
 
67
69
        /* First encode the Python unicode object with UTF-8. */
68
70
        bytes = PyUnicode_AsUTF8String(unicode);
70
72
                PLy_elog(ERROR, "could not convert Python Unicode object to bytes");
71
73
 
72
74
        utf8string = PyBytes_AsString(bytes);
73
 
        if (utf8string == NULL) {
 
75
        if (utf8string == NULL)
 
76
        {
74
77
                Py_DECREF(bytes);
75
78
                PLy_elog(ERROR, "could not extract bytes from encoded string");
76
79
        }
88
91
                PG_TRY();
89
92
                {
90
93
                        encoded = (char *) pg_do_encoding_conversion(
91
 
                                (unsigned char *) utf8string,
92
 
                                strlen(utf8string),
93
 
                                PG_UTF8,
94
 
                                GetDatabaseEncoding());
 
94
                                                                                                (unsigned char *) utf8string,
 
95
                                                                                                                 strlen(utf8string),
 
96
                                                                                                                 PG_UTF8,
 
97
                                                                                                          GetDatabaseEncoding());
95
98
                }
96
99
                PG_CATCH();
97
100
                {