friends-of-reactphp / mysql

Async MySQL database client for ReactPHP.
MIT License
334 stars 66 forks source link

Hangs forever for empty query results #120

Closed zek closed 4 years ago

zek commented 4 years ago

Description

When no record found in table deferred promise never resolved and application waits forever. As I understand we're not handling empty results correctly.

Query

select `t0`.`name` `t0_name`,`t0`.`value` `t0_value`,`t0`.`id` `t0_id` from `settings` `t0` where (`t0`.`name` = 'core:test_dial_prefix') limit 0, 1

Debug log

Note: $fieldCount returns 3


packet size:1
seq:2
[DEBUG] <React\MySQL\Io\Parser:259> Result set row data
packet size:222821
seq:113
[DEBUG] <React\MySQL\Io\Parser:132> Buffer not enouth, return
seq:113
[DEBUG] <React\MySQL\Io\Parser:132> Buffer not enouth, return
``` 
clue commented 4 years ago

It looks like you're using an older version of this project (debugging output doesn't seem to match current version).

I can not reproduce this problem on the current master with a SELECT "name" as t0_name, "value" as t0_value, 0 as t0_id LIMIT 0.

The problem you're describing should have been fixed with https://github.com/friends-of-reactphp/mysql/pull/46 a while ago.

zek commented 4 years ago

@clue thanks for responding. I was using latest version but this problem somehow related to a bug in my code. Same connection being used in multiple places and it was probably closed.

So my bad :)