Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gather affected rows after query call failed #9363

Merged
merged 6 commits into from
Jan 3, 2025

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Jan 2, 2025

Description
This PR fixes a bug in the Postgre and SQLSRV handlers when calling Builder::affectedRows() after a failed query.

This is because when Builder::affectedRows() is called after a failed query, the $resultID is set to false, and a boolean value is not acceptable for either pg_affected_rows() or sqlsrv_rows_affected().

Fixes #9362

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 2, 2025
@michalsn michalsn added the database Issues or pull requests that affect the database layer label Jan 2, 2025
@michalsn michalsn merged commit 046967a into codeigniter4:develop Jan 3, 2025
42 checks passed
@michalsn
Copy link
Member Author

michalsn commented Jan 3, 2025

Thank you everyone!

@michalsn michalsn deleted the fix/affectedRows branch January 3, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: insertBatch not return false
3 participants