From 9f9cbc6744b6b09b650931b9780e858f4a26d782 Mon Sep 17 00:00:00 2001 From: Nicos Panayides Date: Fri, 20 Feb 2026 17:08:42 +0200 Subject: [PATCH 1/3] Fix ci for mariadb --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50cbc1d4..30353d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,8 +80,8 @@ jobs: sleep 2 done - mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_comparisons;' - mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_snapshot;' + docker exec mariadb mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_comparisons;' + docker exec mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_snapshot;' - name: Setup MySQL if: matrix.db-type == 'mysql' run: | From e49b4eb7773256a165f81fcab149d73912899b8f Mon Sep 17 00:00:00 2001 From: Nicos Panayides Date: Fri, 20 Feb 2026 17:09:56 +0200 Subject: [PATCH 2/3] Fix ci for mariadb --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30353d3b..0d2da9cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: sleep 2 done docker exec mariadb mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_comparisons;' - docker exec mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_snapshot;' + docker exec mariadb mariadb -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_snapshot;' - name: Setup MySQL if: matrix.db-type == 'mysql' run: | From 351f1d8e4a2a5f60192f44db1e1a018bb28d1d70 Mon Sep 17 00:00:00 2001 From: Nicos Panayides Date: Fri, 20 Feb 2026 17:17:06 +0200 Subject: [PATCH 3/3] Added collation for MariaDB 11.8 to fix tests. --- tests/TestCase/Db/Adapter/MysqlAdapterTest.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/TestCase/Db/Adapter/MysqlAdapterTest.php b/tests/TestCase/Db/Adapter/MysqlAdapterTest.php index 9687db82..aeee6316 100644 --- a/tests/TestCase/Db/Adapter/MysqlAdapterTest.php +++ b/tests/TestCase/Db/Adapter/MysqlAdapterTest.php @@ -79,13 +79,6 @@ protected function tearDown(): void unset($this->adapter, $this->out, $this->io); } - private function getDefaultCollation(): string - { - return $this->usingMariaDbWithUuid() ? - 'utf8mb4_general_ci' : - 'utf8mb4_0900_ai_ci'; - } - private function usingMysql8(): bool { $version = $this->adapter->getConnection()->getDriver()->version(); @@ -461,7 +454,7 @@ public function testCreateTableAndInheritDefaultCollation() ->save(); $this->assertTrue($adapter->hasTable('table_with_default_collation')); $row = $adapter->fetchRow(sprintf("SHOW TABLE STATUS WHERE Name = '%s'", 'table_with_default_collation')); - $this->assertContains($row['Collation'], ['utf8mb4_general_ci', 'utf8mb4_0900_ai_ci', 'utf8mb4_unicode_ci']); + $this->assertContains($row['Collation'], ['utf8mb4_general_ci', 'utf8mb4_0900_ai_ci', 'utf8mb4_uca1400_ai_ci', 'utf8mb4_unicode_ci']); } public function testCreateTableWithLatin1Collate() @@ -2288,8 +2281,9 @@ public function testDumpCreateTable() $actualOutput = join("\n", $this->out->messages()); // MySQL version affects default collation (8.0.0+ uses utf8mb4_0900_ai_ci, older uses utf8mb4_general_ci) + // MariaDB 11.8 uses: utf8mb4_uca1400_ai_ci $this->assertMatchesRegularExpression( - '/CREATE TABLE `table1` \(`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `column1` VARCHAR\(255\) NOT NULL, `column2` INTEGER, `column3` VARCHAR\(255\) NOT NULL DEFAULT \'test\', PRIMARY KEY \(`id`\)\) ENGINE = InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_(0900_ai_ci|general_ci);/', + '/CREATE TABLE `table1` \(`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `column1` VARCHAR\(255\) NOT NULL, `column2` INTEGER, `column3` VARCHAR\(255\) NOT NULL DEFAULT \'test\', PRIMARY KEY \(`id`\)\) ENGINE = InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_(0900_ai_ci|uca1400_ai_ci|general_ci);/', $actualOutput, 'Passing the --dry-run option does not dump create table query to the output', ); @@ -2398,7 +2392,7 @@ public function testDumpCreateTableAndThenInsert() $actualOutput = preg_replace('~\R~u', '', $actualOutput); // MySQL version affects default collation (8.0.0+ uses utf8mb4_0900_ai_ci, older uses utf8mb4_general_ci) $this->assertMatchesRegularExpression( - '/CREATE TABLE `table1` \(`column1` VARCHAR\(255\) NOT NULL, `column2` INTEGER, PRIMARY KEY \(`column1`\)\) ENGINE = InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_(0900_ai_ci|general_ci);INSERT INTO `table1` \(`column1`, `column2`\) VALUES \(\'id1\', 1\);/', + '/CREATE TABLE `table1` \(`column1` VARCHAR\(255\) NOT NULL, `column2` INTEGER, PRIMARY KEY \(`column1`\)\) ENGINE = InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_(0900_ai_ci|uca1400_ai_ci|general_ci);INSERT INTO `table1` \(`column1`, `column2`\) VALUES \(\'id1\', 1\);/', $actualOutput, 'Passing the --dry-run option does not dump create and then insert table queries to the output', );