From abf8b2fea1b8504581233ba127b7087034ac8807 Mon Sep 17 00:00:00 2001 From: Magnus Hauge Bakke Date: Wed, 21 Feb 2024 17:04:23 +0100 Subject: [PATCH] Skip JoinLateralTest for MySQL < 8.0.14 and MariaDB --- .../Database/MySql/JoinLateralTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Integration/Database/MySql/JoinLateralTest.php b/tests/Integration/Database/MySql/JoinLateralTest.php index 584d95b6a5fc..9ebf3e9301dd 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,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')