mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix failing PDO PgSQL test
This commit is contained in:
commit
56c9ea1881
1 changed files with 9 additions and 5 deletions
|
@ -45,7 +45,7 @@ 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());
|
||||
print_r(normalizeErrorInfo($res->errorInfo()));
|
||||
else
|
||||
print_r($res->fetchAll(PDO::FETCH_ASSOC));
|
||||
|
||||
|
@ -81,13 +81,17 @@ else
|
|||
# Expected to fail; unless told otherwise, PDO assumes string inputs
|
||||
# false -> "" as string, which pgsql doesn't like
|
||||
if (!$res->execute(array(false))) {
|
||||
$err = $res->errorInfo();
|
||||
// Strip additional lines outputted by recent PgSQL versions
|
||||
$err[2] = trim(current(explode("\n", $err[2])));
|
||||
print_r($err);
|
||||
print_r(normalizeErrorInfo($res->errorInfo()));
|
||||
} else {
|
||||
print_r($res->fetchAll(PDO::FETCH_ASSOC));
|
||||
}
|
||||
|
||||
function normalizeErrorInfo(array $err): array {
|
||||
// Strip additional lines outputted by recent PgSQL versions
|
||||
$err[2] = trim(current(explode("\n", $err[2])));
|
||||
return $err;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue