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
This commit is contained in:
Matteo Beccati 2016-08-04 09:37:40 +02:00
commit 70698d1566
4 changed files with 6 additions and 7 deletions

2
NEWS
View File

@ -202,7 +202,7 @@ PHP NEWS
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
without placeholders). (Matteo)
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
specifying a sequence). (Pablo Santiago Sánchez)
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
- Pcntl
. Implemented asynchronous signal handling without TICKS. (Dmitry)

View File

@ -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);

View File

@ -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;

View File

@ -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--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');