summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mysqli/tests/connect.inc7
-rw-r--r--ext/pdo_mysql/tests/mysql_pdo_test.inc11
2 files changed, 15 insertions, 3 deletions
diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index ec837d64b3..ee1dce4640 100644
--- a/ext/mysqli/tests/connect.inc
+++ b/ext/mysqli/tests/connect.inc
@@ -234,7 +234,12 @@
/* MySQL 5.6.1+ */
if ($res = $link->query("SHOW ENGINES")) {
while ($row = $res->fetch_assoc()) {
- if (('InnoDB' == $row['Engine']) && ('YES' == $row['Support'])) {
+ if (!isset($row['Engine']) || !isset($row['Support']))
+ return false;
+
+ if (('InnoDB' == $row['Engine']) &&
+ (('YES' == $row['Support']) || ('DEFAULT' == $row['Support']))
+ ) {
return true;
}
}
diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc
index 0af2e6df65..115aeadc5a 100644
--- a/ext/pdo_mysql/tests/mysql_pdo_test.inc
+++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc
@@ -141,12 +141,19 @@ class MySQLPDOTest extends PDOTest {
}
- static function detect_transactional_mysql_engine($db) {
+ static function detect_transactional_mysql_engine($db) {
foreach ($db->query("show variables like 'have%'") as $row) {
- if ($row[1] == 'YES' && ($row[0] == 'have_innodb' || $row[0] == 'have_bdb')) {
+ if (!empty($row) && $row[1] == 'YES' && ($row[0] == 'have_innodb' || $row[0] == 'have_bdb')) {
return str_replace("have_", "", $row[0]);
}
}
+ /* MySQL 5.6.1+ */
+ foreach ($db->query("SHOW ENGINES") as $row) {
+ if (isset($row['engine']) && isset($row['support'])) {
+ if ('InnoDB' == $row['engine'] && ('YES' == $row['support'] || 'DEFAULT' == $row['support']))
+ return 'innodb';
+ }
+ }
return false;
}