mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Clean up FR #72633
This commit is contained in:
parent
78488a54c8
commit
d3a8e107ac
2
NEWS
2
NEWS
@ -72,7 +72,7 @@ PHP NEWS
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #70313 (PDO statement fails to throw exception). (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)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
|
||||
|
@ -360,12 +360,13 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
|
||||
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);
|
||||
|
@ -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;
|
||||
|
@ -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');
|
Loading…
Reference in New Issue
Block a user