Skip to content

Commit

Permalink
Fix code to address different connection strings for MariaDB (#39374)
Browse files Browse the repository at this point in the history
As per noted in #39311
  • Loading branch information
antoniopaisfernandes authored Oct 26, 2021
1 parent 07fe597 commit b9fc4df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/DatabaseQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ protected function getLockForPopping()
$databaseVersion = $this->database->getConfig('version') ??
$this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);

if (($databaseEngine === 'mysql' && version_compare($databaseVersion, '8.0.1', '>=')) ||
(strpos($databaseVersion, 'MariaDB') && version_compare(Str::after($databaseVersion, '-'), '10.6.0', '>=')) ||
if (($databaseEngine === 'mysql' && ! strpos($databaseVersion, 'MariaDB') && version_compare($databaseVersion, '8.0.1', '>=')) ||
(strpos($databaseVersion, 'MariaDB') && version_compare(Str::after($databaseVersion, '5.5.5-'), '10.6.0', '>=')) ||
($databaseEngine === 'pgsql' && version_compare($databaseVersion, '9.5', '>='))) {
return 'FOR UPDATE SKIP LOCKED';
}
Expand Down

0 comments on commit b9fc4df

Please sign in to comment.