Skip to content

Commit

Permalink
Improved the support for MySQL InnoDB engine
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Feb 17, 2017
1 parent 91ed41e commit 53c554e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions public_html/admin/install/classes/installer.class.php
Expand Up @@ -1113,7 +1113,7 @@ private function autoInstallPlugin($plugin, array $inst_params, $verbose = true)

foreach ($_SQL as $sql) {
if ($useInnodb) {
$sql = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB', $sql);
$sql = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC', $sql);
}
$sql = str_replace('#group#', $adminGroupId, $sql);
DB_query($sql);
Expand Down Expand Up @@ -1372,7 +1372,7 @@ public function pluginAutoInstall($plugin, $inst_params, $verbose = true)

foreach ($_SQL as $sql) {
if ($use_innodb) {
$sql = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB', $sql);
$sql = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC', $sql);
}
$sql = str_replace('#group#', $admin_group_id, $sql);
DB_query($sql);
Expand Down Expand Up @@ -2087,7 +2087,7 @@ private function createDatabaseStructures()
if ($this->env['use_innodb']) {
$dbTableAndData = @file_get_contents($dbTableAndDataPath);
$dbTableAndData = str_replace('<' . '?php', '', $dbTableAndData);
$dbTableAndData = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB', $dbTableAndData);
$dbTableAndData = preg_replace('/ENGINE\s*=\s*MyISAM/i', 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC', $dbTableAndData);
eval($dbTableAndData);
} else {
require_once $dbTableAndDataPath;
Expand Down
4 changes: 2 additions & 2 deletions system/databases/mysql.class.php
Expand Up @@ -418,12 +418,12 @@ public function dbQuery($sql, $ignore_errors = 0)
$option = str_ireplace('type', 'ENGINE', $option);

if ($this->_use_innodb === true) {
$option = str_ireplace('MyISAM', 'InnoDB', $option);
$option = str_ireplace('MyISAM', 'InnoDB ROW_FORMAT=DYNAMIC', $option);
}
} else {
// Appends engine type
$option = ' ENGINE='
. (($this->_use_innodb === true) ? 'InnoDB' : 'MyISAM');
. (($this->_use_innodb === true) ? 'InnoDB ROW_FORMAT=DYNAMIC' : 'MyISAM');
}

// Appends default charset if necessary
Expand Down
4 changes: 2 additions & 2 deletions system/databases/mysqli.class.php
Expand Up @@ -428,12 +428,12 @@ public function dbQuery($sql, $ignore_errors = 0)
$option = str_ireplace('type', 'ENGINE', $option);

if ($this->_use_innodb === true) {
$option = str_ireplace('MyISAM', 'InnoDB', $option);
$option = str_ireplace('MyISAM', 'InnoDB ROW_FORMAT=DYNAMIC', $option);
}
} else {
// Appends engine type
$option = ' ENGINE='
. (($this->_use_innodb === true) ? 'InnoDB' : 'MyISAM');
. (($this->_use_innodb === true) ? 'InnoDB ROW_FORMAT=DYNAMIC' : 'MyISAM');
}

// Appends default charset if necessary
Expand Down

0 comments on commit 53c554e

Please sign in to comment.