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 abf8b2f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 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,19 @@ 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 abf8b2f

Please sign in to comment.