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

fetchAll return false when the result is empty. #14

Open
@andydeng

Description

@andydeng

example:

$pg = $this->pgsqlClientDbPool->get(1);
$s = $pg->query("select * from tbl_company where company_id=12312312"); //something not exist
$data = $pg->fetchAll($s); // the $data variable will be false

foreach ($data as $datum) // there is a warning show up
// do something

The $data variable will be FALSE, and a warning shown up in foreach statement. The code will go only if I check whether the $data is false and then give it an empty array value.

It's different behavior than most client implement.

To change this behavior is easy, change line 864 in swoole_postgresql_coro.cc file, from FAILURE to SUCCESS.

The fetchAll above will return an empty array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions