Skip to content

Commit

Permalink
Merge pull request #2907 from Oldiesmann/release-2.1
Browse files Browse the repository at this point in the history
! More installer tweaks - use InnoDB for all tables
  • Loading branch information
Oldiesmann committed Jun 22, 2015
2 parents b35d70b + ae6aa1f commit 354f8c1
Show file tree
Hide file tree
Showing 3 changed files with 1,741 additions and 1,718 deletions.
13 changes: 11 additions & 2 deletions other/install.php
Expand Up @@ -1058,15 +1058,24 @@ function DatabasePopulation()
// Done with this now
$smcFunc['db_free_result']($get_engines);

$replaces['{$engine}'] = in_array('InnoDB', $engines) ? 'InnoDB' : 'MyISAM';
$replaces['{$memory}'] = in_array('MEMORY', $engines) ? 'MEMORY' : $replaces['{$engine}'];
// InnoDB is better, so use it if possible...
$has_innodb = in_array('InnoDB', $engines);
$replaces['{$engine}'] = $has_innodb ? 'InnoDB' : 'MyISAM';
$replaces['{$memory}'] = (!$has_innodb && in_array('MEMORY', $engines)) ? 'MEMORY' : $replaces['{$engine}'];

// If the UTF-8 setting was enabled, add it to the table definitions.
if (!empty($databases[$db_type]['utf8_support']) && (!empty($databases[$db_type]['utf8_required']) || isset($_POST['utf8'])))
{
$replaces['{$engine}'] .= ' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci';
$replaces['{$memory}'] .= ' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci';
}

// One last thing - if we don't have InnoDB, we can't do transactions...
if (!$has_innodb)
{
$replaces['START TRANSACTION;'] = '';
$replaces['COMMIT;'] = '';
}
}

// Read in the SQL. Turn this on and that off... internationalize... etc.
Expand Down

0 comments on commit 354f8c1

Please sign in to comment.