8000 Merge branch '6.3' into 6.4 · symfony/symfony@1fa7636 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fa7636

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Add test cases for MariaDBPlatform
2 parents e1cc5f2 + 40023eb commit 1fa7636

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

src/Symfony/Bridge/Doctrine/Tests/Types/UlidTypeTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Tests\Types;
1313

1414
use Doctrine\DBAL\Platforms\AbstractPlatform;
15+
use Doctrine\DBAL\Platforms\MariaDBPlatform;
1516
use Doctrine\DBAL\Platforms\MySQLPlatform;
1617
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1718
use Doctrine\DBAL\Platforms\SqlitePlatform;
@@ -140,13 +141,15 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
140141
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
141142
}
142143

143-
public static function provideSqlDeclarations(): array
144+
public static function provideSqlDeclarations(): \Generator
144145
{
145-
return [
146-
[new PostgreSQLPlatform(), 'UUID'],
147-
[new SqlitePlatform(), 'BLOB'],
148-
[new MySQLPlatform(), 'BINARY(16)'],
149-
];
146+
yield [new PostgreSQLPlatform(), 'UUID'];
147+
yield [new SqlitePlatform(), 'BLOB'];
148+
yield [new MySQLPlatform(), 'BINARY(16)'];
149+
150+
if (class_exists(MariaDBPlatform::class)) {
151+
yield [new MariaDBPlatform(), 'BINARY(16)'];
152+
}
150153
}
151154

152155
public function testRequiresSQLCommentHint()

src/Symfony/Bridge/Doctrine/Tests/Types/UuidTypeTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Tests\Types;
1313

1414
use Doctrine\DBAL\Platforms\AbstractPlatform;
15+
use Doctrine\DBAL\Platforms\MariaDBPlatform;
1516
use Doctrine\DBAL\Platforms\MySQLPlatform;
1617
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1718
use Doctrine\DBAL\Platforms\SqlitePlatform;
@@ -152,13 +153,15 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
152153
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
153154
}
154155

155-
public static function provideSqlDeclarations(): array
156+
public static function provideSqlDeclarations(): \Generator
156157
{
157-
return [
158-
[new PostgreSQLPlatform(), 'UUID'],
159-
[new SqlitePlatform(), 'BLOB'],
160-
[new MySQLPlatform(), 'BINARY(16)'],
161-
];
158+
yield [new PostgreSQLPlatform(), 'UUID'];
159+
yield [new SqlitePlatform(), 'BLOB'];
160+
yield [new MySQLPlatform(), 'BINARY(16)'];
161+
162+
if (class_exists(MariaDBPlatform::class)) {
163+
yield [new MariaDBPlatform(), 'BINARY(16)'];
164+
}
162165
}
163166

164167
public function testRequiresSQLCommentHint()

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\DBAL\Driver\ResultStatement;
1616
use Doctrine\DBAL\Exception as DBALException;
1717
use Doctrine\DBAL\Platforms\AbstractPlatform;
18+
use Doctrine\DBAL\Platforms\MariaDBPlatform;
1819
use Doctrine\DBAL\Platforms\MySQL57Platform;
1920
use Doctrine\DBAL\Platforms\OraclePlatform;
2021
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
@@ -388,6 +389,13 @@ public static function providePlatformSql(): iterable
388389
'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
389390
];
390391

392+
if (class_exists(MariaDBPlatform::class)) {
393+
yield 'MariaDB' => [
394+
new MariaDBPlatform(),
395+
'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
396+
];
397+
}
398+
391399
yield 'SQL Server' => [
392400
new SQLServer2012Platform(),
393401
'SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK) WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ',
@@ -469,6 +477,13 @@ public function provideFindAllSqlGeneratedByPlatform(): iterable
469477
'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) LIMIT 50',
470478
];
471479

480+
if (class_exists(MariaDBPlatform::class)) {
481+
yield 'MariaDB' => [
482+
new MariaDBPlatform(),
483+
'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) LIMIT 50',
484+
];
485+
}
486+
472487
yield 'SQL Server' => [
473488
new SQLServer2012Platform(),
474489
'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY (SELECT 0) OFFSET 0 ROWS FETCH NEXT 50 ROWS ONLY',

0 commit comments

Comments
 (0)
0