Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fec00b1

Browse filesBrowse files
Merge branch '4.4' into 5.4
* 4.4: [Messenger] Fix cannot select FOR UPDATE from view on Oracle
2 parents 911fee3 + deb9030 commit fec00b1
Copy full SHA for fec00b1

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Filter options
  • src/Symfony/Component/Messenger/Bridge/Doctrine/Transport
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Doctrine\DBAL\Exception\TableNotFoundException;
1919
use Doctrine\DBAL\LockMode;
2020
use Doctrine\DBAL\Platforms\MySQLPlatform;
21+
use Doctrine\DBAL\Platforms\OraclePlatform;
2122
use Doctrine\DBAL\Query\QueryBuilder;
2223
use Doctrine\DBAL\Result;
2324
use Doctrine\DBAL\Schema\AbstractSchemaManager;
@@ -183,6 +184,18 @@ public function get(): ?array
183184
);
184185
}
185186

187+
// Wrap the rownum query in a sub-query to allow writelocks without ORA-02014 error
188+
if ($this->driverConnection->getDatabasePlatform() instanceof OraclePlatform) {
189+
$sql = str_replace('SELECT a.* FROM', 'SELECT a.id FROM', $sql);
190+
191+
$wrappedQuery = $this->driverConnection->createQueryBuilder()
192+
->select('w.*')
193+
->from($this->configuration['table_name'], 'w')
194+
->where('w.id IN('.$sql.')');
195+
196+
$sql = $wrappedQuery->getSQL();
197+
}
198+
186199
// use SELECT ... FOR UPDATE to lock table
187200
$stmt = $this->executeQuery(
188201
$sql.' '.$this->driverConnection->getDatabasePlatform()->getWriteLockSQL(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.