commit 98e697540307b28f0221e795c32a31373d2842a7 Author: Igor Flista Date: Sat Oct 27 20:06:31 2012 +0300 203955-new_changes diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php index 13fffcb..4356332 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php @@ -121,13 +121,18 @@ public function databaseType() { return 'mysql'; } + /** + * Overrides \Drupal\Core\Database\Connection::createDatabase(). + * + * @throws + */ public function createDatabase($database) { // Escape the database name. // $this->quote() is intended for field values, not database names. It will // therefore put the database name in "quotes" which causes a syntax error // when used here. Use substr() fanciness to remove the beginning and // trailing quotes while leaving the rest of the escaping intact. - $database = substr($this->quote($database), 1, -1); + Database::getConnection()->escapeTable($table); try { // Create the database and set it as active. diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php index e5e65ce..4010c8e 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php @@ -38,7 +38,7 @@ public function minimumVersion() { } /** - * Check if we can connect to the database. + * Checking database connection. */ protected function connect() { try { @@ -67,12 +67,14 @@ protected function connect() { Database::getConnection()->createDatabase($database); } catch (ConnectionDatabaseDoesNotExistException $e) { - // Still no dice; probably a permission issue. Raise the error to the installer. - $this->fail(st('Database %database not found. Attempted to create it, and the server reports the following message: %error.', array('%database' => $database, '%error' => $e->getMessage()))); + // Still no dice; probably a permission issue. Raise the error to the + // installer. + $this->fail(st('Database %database not found. The server reports the following message when attempting to create the database: %error.', array('%database' => $database, '%error' => $e->getMessage()))); } } else { - // Database connection failed for some other reason than the database not existing. + // Database connection failed for some other reason than the database not + // existing. $this->fail(st('Failed to connect to your database server. The server reports the following message: %error.', array('%error' => $e->getMessage()))); return FALSE; }