Fixed check for InnoDB support ("have_innodb" was removed in 5.6)
authorAlexander Ebert <ebert@woltlab.com>
Fri, 28 Jun 2013 14:53:29 +0000 (16:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 28 Jun 2013 14:53:29 +0000 (16:53 +0200)
wcfsetup/install/files/lib/system/WCFSetup.class.php

index 8dbd28f1cbba2d5e77f5dd6f2adf6708c7a8baf5..53c5caafdd9568165230b0054c1f9492cf3d6c77 100644 (file)
@@ -631,11 +631,18 @@ class WCFSetup extends WCF {
                                }
                                // check innodb support
                                if ($dbClass == 'wcf\system\database\MySQLDatabase') {
-                                       $sql = "SHOW VARIABLES WHERE Variable_name = 'have_innodb'";
+                                       $sql = "SHOW ENGINES";
                                        $statement = $db->prepareStatement($sql);
                                        $statement->execute();
-                                       $row = $statement->fetchArray();
-                                       if ($row === false || $row['Value'] != 'YES') {
+                                       $hasInnoDB = false;
+                                       while ($row = $statement->fetchArray()) {
+                                               if ($row['Engine'] == 'InnoDB' && in_array($row['Support'], array('DEFAULT', 'YES'))) {
+                                                       $hasInnoDB = true;
+                                                       break;
+                                               }
+                                       }
+                                       
+                                       if (!$hasInnoDB) {
                                                throw new SystemException("Support for InnoDB is missing.");
                                        }
                                }