Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Update System Uft8mb4 check to handle for the fact that MySQL8 … #22221

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/phpunit/api/v3/SystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public function testSystemUTFMB8Conversion() {
$this->callAPISuccess('System', 'utf8conversion', ['is_revert' => 1]);
$table = CRM_Core_DAO::executeQuery('SHOW CREATE TABLE civicrm_contact');
$table->fetch();
$this->assertStringEndsWith('DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC', $table->Create_Table);
$version = CRM_Utils_SQL::getDatabaseVersion();
$charset = (version_compare($version, '8', '>=') && stripos($version, 'mariadb') === FALSE) ? 'utf8mb3' : 'utf8';
$this->assertStringEndsWith('DEFAULT CHARSET=' . $charset . ' COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC', $table->Create_Table);
}
else {
$this->markTestSkipped('MySQL Version does not support ut8mb4 testing');
Expand Down