From c5e62f9ec15f7a044edcfbdf3faefbb85b72093a Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Thu, 28 Sep 2023 19:08:48 +0800 Subject: [PATCH 1/2] fix: fix the testcase error on mariaDB. --- tests/system/Database/Live/ForgeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index 64bb83772169..0ca737acf975 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -941,7 +941,7 @@ public function testAddFields(): void ], ]; - if (version_compare($this->db->getVersion(), '8.0.17', '>=')) { + if (version_compare($this->db->getVersion(), '8.0.17', '>=') && str_contains($this->db->getVersion(), 'MariaDB') === false) { // As of MySQL 8.0.17, the display width attribute for integer data types // is deprecated and is not reported back anymore. // @see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html From 72825b23deb3931c70986a689926603243a9ae53 Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Fri, 29 Sep 2023 11:25:21 +0800 Subject: [PATCH 2/2] test: change `strpos` function to search the string. --- tests/system/Database/Live/ForgeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index 0ca737acf975..e968ce9f5030 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -941,7 +941,7 @@ public function testAddFields(): void ], ]; - if (version_compare($this->db->getVersion(), '8.0.17', '>=') && str_contains($this->db->getVersion(), 'MariaDB') === false) { + if (version_compare($this->db->getVersion(), '8.0.17', '>=') && strpos($this->db->getVersion(), 'MariaDB') === false) { // As of MySQL 8.0.17, the display width attribute for integer data types // is deprecated and is not reported back anymore. // @see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html