N°1001 switch DB charset from utf8 to utf8mb4 to allow characters outside of the BMP

* use centralized constants instead of literal values in code
* remove config parameters 'db_character_set' and 'db_collation'
* always fix charset when creating/altering column
* backup : use utf8mb4 only for mysqldump >= 5.5.33 (was introduced in 5.5.3 but only available in 5.5.33 for programs)

SVN:trunk[5443]
This commit is contained in:
Pierre Goiffon
2018-03-16 09:59:16 +00:00
parent fd7d30333f
commit b219161011
7 changed files with 171 additions and 55 deletions

View File

@@ -787,7 +787,9 @@ EOF
$aFieldDefs[] = "INDEX (primary_key)";
$sFieldDefs = implode(', ', $aFieldDefs);
$sCreateTable = "CREATE TABLE `$sTable` ($sFieldDefs) ENGINE = ".MYSQL_ENGINE." CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
$sDbCharset = DEFAULT_CHARACTER_SET;
$sDbCollation = DEFAULT_COLLATION;
$sCreateTable = "CREATE TABLE `$sTable` ($sFieldDefs) ENGINE = ".MYSQL_ENGINE." CHARACTER SET ".$sDbCharset." COLLATE ".$sDbCollation.";";
CMDBSource::Query($sCreateTable);
$aTriggers = $this->GetTriggersDefinition();