Skip to content

Commit

Permalink
Skip JoinLateralTest for MySQL < 8.0.14 and MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakke committed Feb 21, 2024
1 parent 8026bd6 commit 08b7b32
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Integration/Database/MySql/JoinLateralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ protected function setUp(): void
{
parent::setUp();

$this->checkMySqlVersion();

DB::table('users')->insert([
['name' => Str::random()],
['name' => Str::random()],
Expand All @@ -50,6 +52,17 @@ protected function setUp(): void
]);
}

protected function checkMySqlVersion()
{
$mySqlVersion = DB::select('select version()')[0]->{'version()'} ?? '';

if (strpos($mySqlVersion, 'Maria') !== false) {
$this->markTestSkipped('Lateral joins are not supported on MariaDB'.__CLASS__);
} elseif ((float) $mySqlVersion < '8.0.14') {
$this->markTestSkipped('Lateral joins are not supported on MySQL < 8.0.14'.__CLASS__);
}
}

public function testJoinLateral()
{
$subquery = DB::table('posts')
Expand Down

0 comments on commit 08b7b32

Please sign in to comment.