Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions tests/swoole_postgres_coro/issue227.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ co::run(function() {

go(function() use ($pg) {
co::sleep(1);
$result2 = $pg->query('SELECT 1');
$row3 = $pg->fetchAssoc($result2);
var_dump($row3);
// Any queries with no fetch methods
$pg->query('SELECT 1'); // AFTER this all another fetching result reset iterator to begin result rows

// Also prepared queries:
// $pg->prepare('selectTwo', 'SELECT 2');
// $pg->execute('selectTwo', []);

// or INSERT/UPDATE request (where most like will not using fetching result)
// $pg->prepare('update', 'UPDATE weather SET prcp = 0.3 WHERE id = 1');
// $pg->execute('update', []); // No need fetching results
});
});
?>
Expand All @@ -56,10 +63,6 @@ array(6) {
["date"]=>
string(10) "1994-11-27"
}
array(1) {
["?column?"]=>
int(1)
}
array(6) {
["id"]=>
int(2)
Expand Down