ext-postgresql icon indicating copy to clipboard operation
ext-postgresql copied to clipboard

Prepared Statement Bug

Open razzbee opened this issue 4 years ago • 5 comments

Hello, errors in a prepared statement doesn't get reported, example:

$stmt = $db->prepare("my_query, "SELECT * from non_existing_table");

Here, non_existing_table doesnt exists, but $stmt returns true
and also :

$db->error is null

razzbee avatar Mar 21 '20 00:03 razzbee

@sy-records I can confirm this is a bug, prepare is always returning true even if it fails. https://github.com/swoole/ext-postgresql/blob/v4.4.x/swoole_postgresql_coro.cc#L620

codercms avatar Apr 05 '20 01:04 codercms

I fixed it in this PR - https://github.com/swoole/ext-postgresql/pull/19 (https://github.com/swoole/ext-postgresql/pull/19/files#diff-f6c52869d82feeba7cef8b1ab64732daR652)

codercms avatar Apr 05 '20 01:04 codercms

Thanks for your contribution, please wait for review. @codercms

sy-records avatar Apr 05 '20 01:04 sy-records

@razzbee #19 is merged into v4.4.x branch. Can you confirm that your issue is resolved?

codercms avatar Apr 09 '20 14:04 codercms

I will provide a feedback after testing, Thanks

razzbee avatar Apr 17 '20 22:04 razzbee