From e9de68f9a33b34653efe75219afcd0923a09df64 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 2 Apr 2010 00:35:48 +0200 Subject: [PATCH] [feature/dbal-tests] Fix mysql (not mysqli) dbal test. Correctly determine MySQL version from the database. --- tests/test_framework/phpbb_database_test_case.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index a80f03b749..d2ebe4c30e 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -126,8 +126,9 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test if ($database_config['dbms'] == 'mysql') { - $pdo->exec('SELECT VERSION() AS version'); + $sth = $pdo->query('SELECT VERSION() AS version'); $row = $sth->fetch(PDO::FETCH_ASSOC); + if (version_compare($row['version'], '4.1.3', '>=')) { $dbms_data['SCHEMA'] .= '_41'; @@ -136,7 +137,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test { $dbms_data['SCHEMA'] .= '_40'; } - unset($row); + + unset($row, $sth); } $sql_query = $this->split_sql_file(file_get_contents("../phpBB/install/schemas/{$dbms_data['SCHEMA']}_schema.sql"), $dbms_data['DELIM']);