From: Matteo Beccati Date: Fri, 25 Dec 2009 20:11:07 +0000 (+0000) Subject: - Updated pdo_pgsql tests to be 8.5+ friendly X-Git-Tag: php-5.4.0alpha1~191^2~2164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=731466cca366e8dc5dc6420f8c9b4c6fcd7fc2c1;p=php - Updated pdo_pgsql tests to be 8.5+ friendly --- diff --git a/ext/pdo/tests/bug_44861.phpt b/ext/pdo/tests/bug_44861.phpt index a392372904..3612561ed6 100644 --- a/ext/pdo/tests/bug_44861.phpt +++ b/ext/pdo/tests/bug_44861.phpt @@ -32,7 +32,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') { $from = ''; } -$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from"; +$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from ORDER BY r"; $aParams = array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL); $res = $db->prepare($query, $aParams); diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt index 0ec04e8bd9..48618e13db 100644 --- a/ext/pdo_pgsql/tests/bug_33876.phpt +++ b/ext/pdo_pgsql/tests/bug_33876.phpt @@ -80,10 +80,14 @@ else # Expected to fail; unless told otherwise, PDO assumes string inputs # false -> "" as string, which pgsql doesn't like -if (!$res->execute(array(false))) - print_r($res->errorInfo()); -else +if (!$res->execute(array(false))) { + $err = $res->errorInfo(); + // Strip additional lines ouputted by recent PgSQL versions + $err[2] = trim(current(explode("\n", $err[2]))); + print_r($err); +} else { print_r($res->fetchAll(PDO::FETCH_ASSOC)); +} diff --git a/ext/pdo_pgsql/tests/bug_49985.phpt b/ext/pdo_pgsql/tests/bug_49985.phpt index 7ada87630a..26dcfc617d 100644 --- a/ext/pdo_pgsql/tests/bug_49985.phpt +++ b/ext/pdo_pgsql/tests/bug_49985.phpt @@ -22,7 +22,7 @@ for ($i = 0; $i < 3; $i++) { var_dump($stmt->execute(array(1))); $db->commit(); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo trim(current(explode("\n", $e->getMessage())))."\n"; $db->rollback(); } }