Properly quoted database name during USE queries to avoid MySQL parse errors (fixes #452)

This commit is contained in:
Nick Mueller
2017-03-07 15:30:04 +01:00
parent a8be8c202f
commit a2da10f4e8
2 changed files with 2 additions and 2 deletions

View File

@@ -925,7 +925,7 @@ class Setup extends Controller {
$checkTables = [];
if($db){
// set/change default "character set" and "collation"
$db->exec('ALTER DATABASE ' . $db->name()
$db->exec('ALTER DATABASE ' . $db->quotekey($db->name())
. ' CHARACTER SET ' . self::getRequiredMySqlVariables('CHARACTER_SET_DATABASE')
. ' COLLATE ' . self::getRequiredMySqlVariables('COLLATION_DATABASE')
);