Browse Source

MFH:

- Removed HAVE_PQEXECPARAMS which was left out during the previous commit
experimental/5.3-FPM
Matteo Beccati 17 years ago
parent
commit
b8910c99ea
  1. 1
      ext/pdo_pgsql/config.w32
  2. 16
      ext/pdo_pgsql/pgsql_driver.c

1
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');

16
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)) {

Loading…
Cancel
Save