From d2cae0ccba2f36ebe8091273de922f17932ec5db Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Mon, 10 Jul 2006 07:39:23 +0000 Subject: [PATCH] SHOW ENGINES is only available in PHP 4.1.2 and above (and the output format slightly changed between 4.1 and 5.0, too), SHOW VARIABLES LIKE 'have_%' is the more portable alternative here --- ext/pdo/tests/pdo_test.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc index 6696fe12d71..528238618b3 100644 --- a/ext/pdo/tests/pdo_test.inc +++ b/ext/pdo/tests/pdo_test.inc @@ -64,9 +64,9 @@ class PDOTest { } static function detect_transactional_mysql_engine($db) { - foreach ($db->query('show engines') as $row) { - if ($row[1] == 'YES' && ($row[0] == 'INNOBASE' || $row[0] == 'BDB')) { - return $row[0]; + foreach ($db->query("show variables like 'have%'") as $row) { + if ($row[1] == 'YES' && ($row[0] == 'have_innodb' || $row[0] == 'have_bdb')) { + return str_replace("have_", "", $row[0]); } } return false;