diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2ceca79e018397a6f06ad4436d0ea5a9e1d695d5..0edb482262fc98b59a9b178e405206c33aa6c617 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,8 @@ Drupal 7.0, xxxx-xx-xx (development version) * Support for master/slave replication, transactions, multi-insert queries, delayed inserts, and other features. * Added support for the SQLite database engine. + * Default to InnoDB engine, rather than MyISAM, on MySQL when available. + This offers increased scalability and data integrity. - Security: * Protected cron.php -- cron will only run if the proper key is provided. * Implemented much stronger password hashes that are also compatible with the diff --git a/INSTALL.mysql.txt b/INSTALL.mysql.txt index ae50ebb4061637e041f549001b8953e689f1a479..a5490a5afa7f27a57f4108f2a4bee93cf07a9b6a 100644 --- a/INSTALL.mysql.txt +++ b/INSTALL.mysql.txt @@ -38,3 +38,6 @@ If successful, MySQL will reply with: Query OK, 0 rows affected +If the InnoDB storage engine is available, it will be used for all database +tables. InnoDB provides features over MyISAM such as transaction support, +row-level locks, and consistent non-locking reads. diff --git a/includes/database/mysql/schema.inc b/includes/database/mysql/schema.inc index aa0905a35560fa57417a7abe0e9543fe5b7f044e..ff380ba9dcd20243de82d3ed1cb2dbd165c1d98d 100644 --- a/includes/database/mysql/schema.inc +++ b/includes/database/mysql/schema.inc @@ -59,9 +59,11 @@ protected function buildTableNameCondition($table_name, $operator = '=') { * An array of SQL statements to create the table. */ protected function createTableSql($name, $table) { - if (empty($table['mysql_suffix'])) { - $table['mysql_suffix'] = 'DEFAULT CHARACTER SET UTF8'; - } + // Provide some defaults if needed + $table += array( + 'mysql_engine' => 'InnoDB', + 'mysql_character_set' => 'UTF8', + ); $sql = "CREATE TABLE {" . $name . "} (\n"; @@ -79,7 +81,7 @@ protected function createTableSql($name, $table) { // Remove the last comma and space. $sql = substr($sql, 0, -3) . "\n) "; - $sql .= $table['mysql_suffix']; + $sql .= 'ENGINE = ' . $table['mysql_engine'] . ' DEFAULT CHARACTER SET ' . $table['mysql_character_set']; // Add table comment. if (!empty($table['description'])) {