cvs: php-src /ext/pdo/tests pdo_test.inc
| From: | Hartmut Holzgraefe | Date: | Mon, 10 Jul 2006 07:39:23 +0000 |
| Subject: | cvs: php-src /ext/pdo/tests pdo_test.inc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-39099@lists.php.net to get a copy of this message | ||
hholzgra Mon Jul 10 07:39:23 2006 UTC
Modified files:
/php-src/ext/pdo/tests pdo_test.inc
Log:
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
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/pdo_test.inc?r1=1.14&r2=1.15&diff_format=u
Index: php-src/ext/pdo/tests/pdo_test.inc
diff -u php-src/ext/pdo/tests/pdo_test.inc:1.14 php-src/ext/pdo/tests/pdo_test.inc:1.15
--- php-src/ext/pdo/tests/pdo_test.inc:1.14 Wed Mar 8 00:43:28 2006
+++ php-src/ext/pdo/tests/pdo_test.inc Mon Jul 10 07:39:23 2006
@@ -64,9 +64,9 @@
}
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;