Skip to content

fix: gather affected rows after query call failed - #9363

Merged
michalsn merged 6 commits into
codeigniter4:developfrom
michalsn:fix/affectedRows
Jan 3, 2025
Merged

fix: gather affected rows after query call failed#9363
michalsn merged 6 commits into
codeigniter4:developfrom
michalsn:fix/affectedRows

Conversation

@michalsn

@michalsnmichalsn commented Jan 2, 2025

Copy link
Copy Markdown
Member

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

@michalsnmichalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 2, 2025
@michalsnmichalsn added the database Issues or pull requests that affect the database layer label Jan 2, 2025
Comment threadtests/system/Database/Live/InsertTest.php
@michalsn
michalsn merged commit 046967a into codeigniter4:developJan 3, 2025
@michalsn

Copy link
Copy Markdown
MemberAuthor

Thank you everyone!

@michalsn
michalsn deleted the fix/affectedRows branch January 3, 2025 10:54
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugVerified issues on the current code behavior or pull requests that will fix themdatabaseIssues 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

@michalsn@samsonasik@paulbalandan