From ba2644b45bcbe4d31a09ea8031549e8d62acf6cf Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Mon, 5 Oct 2026 07:42:24 -0500 Subject: [PATCH] fix: align the session table collation with the rest of the fleet The session table was created with utf8mb4_unicode_ci while acl_role, acl_rule, user and the log table all declare utf8mb4_0900_ai_ci. Any query comparing a session string column to another table's string column raises "Illegal mix of collations". Sets the table collation to utf8mb4_0900_ai_ci - the MySQL 8+ server default and what the sibling packages already declare - and updates the unit assertions that pinned the old literal. Signed-off-by: Joey Smith Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Joey Smith --- src/Session/Console/Schema/SessionSchema.php | 2 +- test/unit/Session/Console/Schema/SessionSchemaTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Session/Console/Schema/SessionSchema.php b/src/Session/Console/Schema/SessionSchema.php index 0c0fc55..c6f6958 100644 --- a/src/Session/Console/Schema/SessionSchema.php +++ b/src/Session/Console/Schema/SessionSchema.php @@ -70,7 +70,7 @@ public function sessionTable(string $table): CreateTable $createTable->setOptions(options: [ 'engine' => new Literal(literal: 'InnoDB'), 'default charset' => new Literal(literal: 'utf8mb4'), - 'collate' => new Literal(literal: 'utf8mb4_unicode_ci'), + 'collate' => new Literal(literal: 'utf8mb4_0900_ai_ci'), ]); return $createTable; diff --git a/test/unit/Session/Console/Schema/SessionSchemaTest.php b/test/unit/Session/Console/Schema/SessionSchemaTest.php index b394c8b..7ce328e 100644 --- a/test/unit/Session/Console/Schema/SessionSchemaTest.php +++ b/test/unit/Session/Console/Schema/SessionSchemaTest.php @@ -70,7 +70,7 @@ public function sessionTableOptionsSetEngineCharsetAndCollation(): void self::assertInstanceOf(Literal::class, $options['engine']); self::assertSame('InnoDB', $options['engine']->getLiteral()); self::assertSame('utf8mb4', $options['default charset']->getLiteral()); - self::assertSame('utf8mb4_unicode_ci', $options['collate']->getLiteral()); + self::assertSame('utf8mb4_0900_ai_ci', $options['collate']->getLiteral()); } #[Test] @@ -90,7 +90,7 @@ public function sessionTableRendersTheExactStatement(): void . '`expires_at` DATETIME NOT NULL , ' . 'PRIMARY KEY (`id`), ' . 'INDEX `idx_expires_at`(`expires_at`) ' - . ') ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci', + . ') ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci', $sql, ); }