Skip to content

Commit

Permalink
temptable not using utf8mb4 if server default already set
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Jul 31, 2020
1 parent 4e744bf commit a3b5aef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CRM/Utils/SQL/TempTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ public function getUtf8String() {
return '';
}
$dbUTF = CRM_Core_BAO_SchemaHandler::getDBCollation();
if (in_array($dbUTF, ['utf8_unicode_ci', 'utf8mb4_unicode_ci'])
&& in_array($dbUTF, ['utf8', 'utf8mb4'])) {
if (strpos($dbUTF, 'utf8') !== FALSE) {
return '';
}
return self::UTF8;
Expand All @@ -168,7 +167,7 @@ public function createWithColumns($columns) {
$this->toSQL('CREATE'),
$columns,
$this->memory ? self::MEMORY : self::INNODB,
$this->utf8 ? self::UTF8 : ''
$this->getUtf8String(),
);
CRM_Core_DAO::executeQuery($sql, [], TRUE, NULL, TRUE, FALSE);
$this->createSql = $sql;
Expand Down

0 comments on commit a3b5aef

Please sign in to comment.