aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/Adapter.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/DB/Adapter.php')
-rw-r--r--lib/private/DB/Adapter.php20
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php
index edd8c1bf023..8f1b8e6d75f 100644
--- a/lib/private/DB/Adapter.php
+++ b/lib/private/DB/Adapter.php
@@ -28,25 +28,11 @@ class Adapter {
/**
* @param string $table name
*
- * @return int id of last insert statement, 0 in case there was no INSERT before or it failed to get the ID
+ * @return int id of last insert statement
* @throws Exception
*/
- public function lastInsertId($table, bool $allowRetry = true): int {
- $return = $this->conn->realLastInsertId($table);
- if ($return === 0 && $allowRetry) {
- /**
- * During a reconnect we are losing the connection and when the
- * realLastInsertId call is the one triggering the reconnect, it
- * does not return the ID. But inside the reconnect, we were able
- * to save the last insert id, so calling it a second time is going
- * to be successful.
- * We can not return the result on the initial call, as we are already
- * way deeper in the stack performing the actual database query on
- * the doctrine driver.
- */
- return $this->lastInsertId($table, false);
- }
- return $return;
+ public function lastInsertId($table) {
+ return (int)$this->conn->realLastInsertId($table);
}
/**