Skip to content

Commit

Permalink
Allow overriding the MySQL server version for database queuedriver (#…
Browse files Browse the repository at this point in the history
…35263)

Co-authored-by: Christian Frøystad <christian@securepractice.no>
  • Loading branch information
cfroystad and cfroystad committed Nov 18, 2020
1 parent 910d5ed commit a7e7852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/DatabaseQueue.php
Expand Up @@ -233,7 +233,7 @@ protected function getNextAvailableJob($queue)
protected function getLockForPopping()
{
$databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
$databaseVersion = $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
$databaseVersion = $this->database->getConfig('version') ?? $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);

if ($databaseEngine == 'mysql' && ! strpos($databaseVersion, 'MariaDB') && version_compare($databaseVersion, '8.0.1', '>=') ||
$databaseEngine == 'pgsql' && version_compare($databaseVersion, '9.5', '>=')) {
Expand Down

0 comments on commit a7e7852

Please sign in to comment.