]> granicus.if.org Git - php/commitdiff
MFH:
authorMatteo Beccati <mbeccati@php.net>
Thu, 30 Apr 2009 12:56:00 +0000 (12:56 +0000)
committerMatteo Beccati <mbeccati@php.net>
Thu, 30 Apr 2009 12:56:00 +0000 (12:56 +0000)
- Removed HAVE_PQEXECPARAMS which was left out during the previous commit

ext/pdo_pgsql/config.w32
ext/pdo_pgsql/pgsql_driver.c

index 518f6d593e68a4f88c1d8f5f2665b3a6b3df65c5..223780e3f96529ce4b720fc9e0be84a61176ba69 100644 (file)
@@ -15,7 +15,6 @@ if (PHP_PDO_PGSQL != "no") {
                AC_DEFINE('HAVE_PDO_PGSQL',             1, 'Have PostgreSQL library');
                AC_DEFINE('HAVE_PQESCAPE_BYTEA_CONN',   1, 'Have PQescapeByteaConn');
                AC_DEFINE('HAVE_PQESCAPE_CONN',         1, 'Have PQescapeConn');
-               AC_DEFINE('HAVE_PQEXECPARAMS',          1, 'Have PQexecParams');
                AC_DEFINE('HAVE_PQPREPARE',             1, 'Have PQprepare');
                ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1 /D HAVE_PQESCAPE_CONN=1 /D HAVE_PQESCAPE_BYTEA_CONN=1");
                ADD_EXTENSION_DEP('pdo_pgsql', 'pdo');
index 80b34c903925c94f4ce03b2853b9e8dfdaa400a9..4d4d8dbb9d120517552888adaf2dfa944f436717 100644 (file)
@@ -356,25 +356,9 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
        } else {
                PGresult *res;
                ExecStatusType status;
-#ifdef HAVE_PQEXECPARAMS
                const char *q[1];
                q[0] = name;
                res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0);
-#else
-               char *name_escaped, *q;
-               size_t l = strlen(name);
-        
-               name_escaped = safe_emalloc(l, 2, 1);
-#ifndef HAVE_PQESCAPE_CONN
-               PQescapeString(name_escaped, name, l);
-#else
-               PQescapeStringConn(H->server, name_escaped, name, l, NULL);
-#endif
-               spprintf(&q, 0, "SELECT CURRVAL('%s')", name_escaped);
-               res = PQexec(H->server, q);
-               efree(name_escaped); 
-               efree(q);
-#endif
                status = PQresultStatus(res);
 
                if (res && (status == PGRES_TUPLES_OK)) {