Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Workaround for Oracle trigger for fileid
  • Loading branch information
Vincent Petry committed Sep 19, 2017
commit 4c157211685c450b46437b1188ed849676670617
14 changes: 14 additions & 0 deletions lib/private/Repair/RepairMismatchFileCachePath.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,20 @@ private function getOrCreateEntry($storageId, $path, $reuseFileId = null) {

// If we reused the fileid then this is the id to return
if($reuseFileId !== null) {
// with Oracle, the trigger gets in the way and does not let us specify
// a fileid value on insert
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
$lastFileId = $this->connection->lastInsertId('*PREFIX*filecache');
if ($reuseFileId !== $lastFileId) {
// use update to set it directly
$qb = $this->connection->getQueryBuilder();
$qb->update('filecache')
->set('fileid', $qb->createNamedParameter($reuseFileId))
->where($qb->expr()->eq('fileid', $qb->createNamedParameter($lastFileId)));
$qb->execute();
}
}

return $reuseFileId;
} else {
// Else we inserted a new row with auto generated id, use that
Expand Down