Skip to content
Snippets Groups Projects
Commit 929d53f6 authored by Anja Leichsenring's avatar Anja Leichsenring Committed by Georg Ringer
Browse files

[BUGFIX] Prevent extbase persistance to try last_insert_id on relations

Postgres will fail with an error, if a table sequence is requested for
a table without auto_increment column. MySql will just return '0'.
Test the relation type before trying to persist mm relations to
prevent that error.

Resolves: #80562
Releases: master
Change-Id: Ia429e681a8ec1805996da03bd738b8347a00e40d
Reviewed-on: https://review.typo3.org/52251


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent a1b592f6
......@@ -146,9 +146,10 @@ class Typo3DbBackend implements BackendInterface, SingletonInterface
throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230766);
}
$uid = $connection->lastInsertId($tableName);
$uid = 0;
if (!$isRelation) {
// Relation tables have no auto_increment column, so no retrieval must be tried.
$uid = $connection->lastInsertId($tableName);
$this->clearPageCache($tableName, $uid);
}
return (int)$uid;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment