Commit 2edb8e01 authored by Son Nguyen's avatar Son Nguyen Committed by Aaron Wells
Browse files

Fix InnoDB verification issue for MySQL 5.6 (Bug #1180243)

Use the command 'SHOW ENGINES' instead of 'SHOW VARIABLES'
See also:
http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_have_innodb



Change-Id: Ib97f7e1fdcc3c305db7864359fee7626f2f8a4f3
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
Signed-off-by: Aaron Wells's avatarAaron Wells <aaronw@catalyst.net.nz>
parent 8e9f8ef3
......@@ -67,9 +67,19 @@ function check_upgrades($name=null) {
}
if (empty($coreversion)) {
if (is_mysql()) { // Show a more informative error message if using mysql with skip-innodb
// In MySQL 5.6.x, we run the command 'SHOW ENGINES' to check if InnoDB is enabled or not
global $db;
$result = $db->Execute("SHOW VARIABLES LIKE 'have_innodb'");
if ($result->fields['Value'] != 'YES') {
$result = $db->Execute("SHOW ENGINES");
$hasinnodb = false;
while (!$result->EOF) {
if ($result->fields['Engine'] == 'InnoDB' && ($result->fields['Support'] == 'YES' || $result->fields['Support'] == 'DEFAULT')) {
$hasinnodb = true;
break;
}
$result->MoveNext();
}
if (!$hasinnodb) {
throw new ConfigSanityException("Mahara requires InnoDB tables. Please ensure InnoDB tables are enabled in your MySQL server.");
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment