Skip to content

Commit

Permalink
exclude mariaDB from database queue support for new SKIP LOCKED
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Feb 20, 2020
1 parent 641a7cd commit fff96e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/DatabaseQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ protected function getLockForPopping()
$databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
$databaseVersion = $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);

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

5 comments on commit fff96e7

@mchitaru
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! On which release will this fix be available?

@GrahamCampbell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.17.0, which will be released some time in the next 12 hours.

@antoniopaisfernandes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

MariaDB supports this syntax starting from 10.6.

Reference: https://mariadb.com/kb/en/select/#skip-locked

Can this change be updated to address that support?

Best regards

@GrahamCampbell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best way to get in touch is to open a new issue, not comment on commits over a year old. Please do that.

@antoniopaisfernandes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GrahamCampbell,

I've added a pull request to minimize work/effort you have with Laravel. Thank you for your work with open-source tools we use.

Wish you the best.

Please sign in to comment.