Skip to content

Commit abf8b2f

Browse files
committed
Skip JoinLateralTest for MySQL < 8.0.14 and MariaDB
1 parent 8026bd6 commit abf8b2f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Integration/Database/MySql/JoinLateralTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ protected function setUp(): void
3838
{
3939
parent::setUp();
4040

41+
$this->checkMySqlVersion();
42+
4143
DB::table('users')->insert([
4244
['name' => Str::random()],
4345
['name' => Str::random()],
@@ -50,6 +52,19 @@ protected function setUp(): void
5052
]);
5153
}
5254

55+
protected function checkMySqlVersion()
56+
{
57+
$mySqlVersion = DB::select('select version()')[0]->{'version()'} ?? '';
58+
59+
if (strpos($mySqlVersion, 'Maria') !== false) {
60+
$this->markTestSkipped('Lateral joins are not supported on MariaDB'.__CLASS__);
61+
} elseif ((float) $mySqlVersion < '8.0.14') {
62+
$this->markTestSkipped('Lateral joins are not supported on MySQL < 8.0.14'.__CLASS__);
63+
64+
}
65+
}
66+
67+
5368
public function testJoinLateral()
5469
{
5570
$subquery = DB::table('posts')

0 commit comments

Comments
 (0)