|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-01-20 08:36 UTC] enumag at gmail dot com
Description: ------------ You don't need to have postgres installed or running - I don't. This fails regardless. Reproducing code is taken from amphp/postgres readme https://github.com/amphp/postgres). Test script: --------------- <?php declare(strict_types = 1); use Amp\Postgres; use Amp\Postgres\ConnectionConfig; use Amp\Sql\Statement; require __DIR__.'/vendor/autoload.php'; Amp\Loop::run(function () { $config = ConnectionConfig::fromString("host=localhost user=postgres dbname=test"); /** @var Postgres\Pool $pool */ $pool = Postgres\pool($config); /** @var Statement $statement */ $statement = yield $pool->prepare("SELECT * FROM test WHERE id = :id"); /** @var Postgres\ResultSet $result */ $result = yield $statement->execute(['id' => 1337]); while (yield $result->advance()) { $row = $result->getCurrent(); // $row is an array (map) of column values. e.g.: $row['column_name'] } }); Expected result: ---------------- Some normal amphp/postgres error saying that connecting to postgres failed. Actual result: -------------- *** stack smashing detected ***: <unknown> terminated [1] 4059 abort (core dumped) php amp.php PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
I can't reproduce this with current 7.4 HEAD. I get: Fatal error: Uncaught Amp\Sql\ConnectionException: fe_sendauth: no password supplied in /home/nikic/repos/postgres/src/PgSqlConnection.php:58 Stack trace: #0 /home/nikic/repos/postgres/vendor/amphp/amp/lib/Loop/NativeDriver.php(223): Amp\Postgres\PgSqlConnection::Amp\Postgres\{closure}('e', Resource id #53, NULL) #1 /home/nikic/repos/postgres/vendor/amphp/amp/lib/Loop/NativeDriver.php(97): Amp\Loop\NativeDriver->selectStreams(Array, Array, 0.421) #2 /home/nikic/repos/postgres/vendor/amphp/amp/lib/Loop/Driver.php(134): Amp\Loop\NativeDriver->dispatch(true) #3 /home/nikic/repos/postgres/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick() #4 /home/nikic/repos/postgres/vendor/amphp/amp/lib/Loop.php(84): Amp\Loop\Driver->run() #5 /home/nikic/repos/postgres/test.php(24): Amp\Loop::run(Object(Closure)) #6 {main} thrown in /home/nikic/repos/postgres/src/PgSqlConnection.php on line 58 without any warnings under valgrind.