Merge pull request #454 from MorpheusXAUT/bug-452
Properly quoted database name during USE queries to avoid MySQL parse errors
This commit is contained in:
@@ -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')
|
||||
);
|
||||
|
||||
@@ -52,7 +52,7 @@ class TableModifier extends SQL\TableModifier {
|
||||
':constraint_name' => $constraintName
|
||||
]);
|
||||
// switch back to current DB
|
||||
$this->db->exec("USE " . $this->db->name());
|
||||
$this->db->exec("USE " . $this->db->quotekey($this->db->name()));
|
||||
|
||||
$constraints = [];
|
||||
foreach($constraintsData as $data){
|
||||
|
||||
Reference in New Issue
Block a user