diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 25be979e9b4..daa55eb2a96 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -482,7 +482,7 @@ This version is for PHP 7 only. Fixed bug #71600 (oci_fetch_all segfaults when selecting more than 8 columns) - + 2.1.0 diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index da62aabac63..d1e501344a4 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -45,7 +45,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.1.1" +#define PHP_OCI8_VERSION "2.1.2" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 9b7e38c24e3..d33df7663b8 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); diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 86fc847633b..30c2cc2d522 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -29,8 +29,6 @@ #define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006" -#define PHP_PDO_PGSQL_LASTVAL_PG_VERSION 80100 - typedef struct { const char *file; int line; diff --git a/ext/pdo_pgsql/tests/bug_last_insert_id.phpt b/ext/pdo_pgsql/tests/bug72633.phpt similarity index 86% rename from ext/pdo_pgsql/tests/bug_last_insert_id.phpt rename to ext/pdo_pgsql/tests/bug72633.phpt index 30dd0f039a0..06bd25e6268 100644 --- a/ext/pdo_pgsql/tests/bug_last_insert_id.phpt +++ b/ext/pdo_pgsql/tests/bug72633.phpt @@ -1,5 +1,5 @@ --TEST-- -currval() vs lastval() - PDO PgSQL Bug #1134 [BUG] New record, PostgreSQL and the Primary key https://github.com/phalcon/cphalcon/issues/1134 +PDO PgSQL Bug #72633 (Postgres PDO lastInsertId() should work without specifying a sequence) --SKIPIF--