Skip to content

Conversation

michalsn
Copy link
Member

Description
This PR fixes values returned by the Connection::getFieldData() method for the default field.

In OCI8, Oracle may add trailing spaces to DATA_DEFAULT for NOT NULL columns - a known behavior. For confirmation, see this Stack Overflow thread.

In SQLSRV, default values are returned in their native format, which is correct by design. However, since we provide a database abstraction, this PR normalizes default values to match the format used by other handlers. This ensures that retrieved metadata can be safely reused when modifying table fields, without introducing inconsistencies.

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 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 labels Aug 13, 2025
@michalsn michalsn merged commit da25ed2 into codeigniter4:develop Aug 14, 2025
82 of 84 checks passed
@michalsn
Copy link
Member Author

Thank you @paulbalandan and @neznaika0

@michalsn michalsn deleted the fix/connection-getFieldData branch August 20, 2025 06:12
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.

3 participants