From b8910c99ea2157b1308f727cc2b710be01b7c5fa Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Thu, 30 Apr 2009 12:56:00 +0000 Subject: [PATCH] MFH: - Removed HAVE_PQEXECPARAMS which was left out during the previous commit --- ext/pdo_pgsql/config.w32 | 1 - ext/pdo_pgsql/pgsql_driver.c | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32 index 518f6d593e..223780e3f9 100644 --- a/ext/pdo_pgsql/config.w32 +++ b/ext/pdo_pgsql/config.w32 @@ -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'); diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 80b34c9039..4d4d8dbb9d 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -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)) { -- 2.40.0