Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

fetch bug when coroutine yield #29

Open
Yurunsoft opened this issue Jun 1, 2020 · 0 comments
Open

fetch bug when coroutine yield #29

Yurunsoft opened this issue Jun 1, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@Yurunsoft
Copy link
Member

Yurunsoft commented Jun 1, 2020

Code:

<?php

Co\run(function () {
    $pg = new Swoole\Coroutine\PostgreSQL();
    $conn = $pg->connect("host=127.0.0.1 port=5432 dbname=test user=postgres password=1");
    var_dump($conn, $pg->error);
    $res = $pg->query('select * from tb_user');
    \Swoole\Coroutine::sleep(1); // yield
    var_dump($pg->fetchArray($res), $pg->error);
});

Output:

bool(true)
NULL
bool(false)
NULL
@huanghantao huanghantao added the bug Something isn't working label Jun 1, 2020
Yurunsoft added a commit to Yurunsoft/ext-postgresql that referenced this issue Jul 26, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants