mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix failing PDO PgSQL test
This commit is contained in:
commit
90ceac6f7c
1 changed files with 9 additions and 5 deletions
|
@ -47,7 +47,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));
|
||||
|
||||
|
@ -83,13 +83,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