diff --git a/tests/Integration/Database/MySql/JoinLateralTest.php b/tests/Integration/Database/MySql/JoinLateralTest.php index 584d95b6a5fc..a106c065197e 100644 --- a/tests/Integration/Database/MySql/JoinLateralTest.php +++ b/tests/Integration/Database/MySql/JoinLateralTest.php @@ -38,6 +38,8 @@ protected function setUp(): void { parent::setUp(); + $this->checkMySqlVersion(); + DB::table('users')->insert([ ['name' => Str::random()], ['name' => Str::random()], @@ -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')