Skip to content

Commit fd4e493

Browse files
committed
choose the correctly cased class name for the MariaDB platform
1 parent 05ba52b commit fd4e493

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Doctrine\DBAL\Connection as DBALConnection;
1515
use Doctrine\DBAL\Exception as DBALException;
1616
use Doctrine\DBAL\Platforms\AbstractPlatform;
17-
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
1817
use Doctrine\DBAL\Platforms\MariaDBPlatform;
1918
use Doctrine\DBAL\Platforms\MySQL57Platform;
2019
use Doctrine\DBAL\Platforms\MySQL80Platform;
@@ -590,9 +589,16 @@ class_exists(MySQLPlatform::class) ? new MySQLPlatform() : new MySQL57Platform()
590589
'SELECT m.* FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
591590
];
592591

593-
if (class_exists(MariaDb1060Platform::class)) {
592+
if (interface_exists(DBALException::class)) {
593+
// DBAL 4+
594+
$mariaDbPlatformClass = 'Doctrine\DBAL\Platforms\MariaDB1060Platform';
595+
} else {
596+
$mariaDbPlatformClass = 'Doctrine\DBAL\Platforms\MariaDb1060Platform';
597+
}
598+
599+
if (class_exists($mariaDbPlatformClass)) {
594600
yield 'MariaDB106' => [
595-
new MariaDb1060Platform(),
601+
new $mariaDbPlatformClass(),
596602
'SELECT m.* FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE SKIP LOCKED',
597603
];
598604
}

0 commit comments

Comments
 (0)