diff options
author | Matteo Beccati <mbeccati@php.net> | 2016-08-04 09:37:40 +0200 |
---|---|---|
committer | Matteo Beccati <mbeccati@php.net> | 2016-08-04 09:37:40 +0200 |
commit | 70698d15662e17d5832d0316b358195c486226a5 (patch) | |
tree | 8e9f4d60b860a2abfd0c2abb927126329c2d72ce /ext/pdo_pgsql/pgsql_driver.c | |
parent | 0781f512c38024c9f69720a72de11857cd546456 (diff) | |
parent | 4003595d6000477e86db9c868375acb577f47131 (diff) | |
download | php-git-70698d15662e17d5832d0316b358195c486226a5.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Clean up FR #72633
Fixed invalid handle error with Implicit Result Sets and bump OCI8 version.
Conflicts:
ext/oci8/package.xml
Diffstat (limited to 'ext/pdo_pgsql/pgsql_driver.c')
-rw-r--r-- | ext/pdo_pgsql/pgsql_driver.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 9b7e38c24e..d33df7663b 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -363,12 +363,13 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, size_t * char *id = NULL; PGresult *res; ExecStatusType status; - const char *q[1]; - q[0] = name; - if (PHP_PDO_PGSQL_LASTVAL_PG_VERSION <= PQserverVersion(H->server) && name == NULL) { + if (name == NULL) { res = PQexec(H->server, "SELECT LASTVAL()"); } else { + const char *q[1]; + q[0] = name; + res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0); } status = PQresultStatus(res); |