[-] Classes : Db classe fixed (check InnoDB support MySQL >= 5.6)

This commit is contained in:
Francois Gaillard
2013-05-30 16:23:24 +02:00
parent 5812b5be71
commit dfac99dc64
2 changed files with 32 additions and 4 deletions
+16 -2
View File
@@ -168,13 +168,27 @@ class MySQLCore extends Db
if (strtolower($engine) == 'innodb')
{
$value = 0;
$sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\'';
$result = mysql_query($sql);
if (!$result)
return 4;
$value = 4;
$row = mysql_fetch_assoc($result);
if (!$row || strtolower($row['Value']) != 'yes')
return 4;
$value = 4;
/* MySQL >= 5.6 */
$sql = 'SHOW ENGINES';
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result))
if ($row['Engine'] == 'InnoDB')
{
if (in_array($row['Support'], array('DEFAULT', 'YES')))
$value = 0;
break;
}
return $value;
}
@mysql_close($link);
return 0;