Skip to content

Commit

Permalink
Make sure we really don't try to receive the last id if we don't have…
Browse files Browse the repository at this point in the history
… a sequence name. See https://bugs.php.net/bug.php?id=72759.
  • Loading branch information
yunosh committed Aug 30, 2016
1 parent 38fb79f commit 64c5ff7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions framework/Db/lib/Horde/Db/Adapter/Pdo/Pgsql.php
Expand Up @@ -144,9 +144,9 @@ public function insert($sql, $arg1 = null, $arg2 = null, $pk = null,
}

// Otherwise, insert then grab last_insert_id.
if ($insertId = parent::insert($sql, $arg1, $arg2, $pk, $idValue, $sequenceName)) {
$this->resetPkSequence($table, $pk, $sequenceName);
return $insertId;
$this->execute($sql, $arg1, $arg2);
if ($idValue) {
return $idValue;
}

// If a pk is given, fallback to default sequence name.
Expand Down
4 changes: 2 additions & 2 deletions framework/Db/package.xml
Expand Up @@ -34,7 +34,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Fix failing transactions if retrieving last INSERT ID from PostgreSQL fails on PHP 7.2.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -942,7 +942,7 @@
<date>2016-07-02</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Fix failing transactions if retrieving last INSERT ID from PostgreSQL fails on PHP 7.2.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 64c5ff7

Please sign in to comment.