Skip to content

Fix MySQL 8.4.0 and DBAL 4.x compatibility issues #137

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

Merged
merged 15 commits into from
Jun 25, 2025

Conversation

cyppe
Copy link
Contributor

@cyppe cyppe commented Jun 22, 2025

This PR addresses the maintainer feedback from #116 and fixes additional compatibility issues:

Maintainer Feedback Addressed:

  • Fixed readInt64() and unpackUInt64() to always return strings as requested
  • Applied code style fixes with composer cs:fix

DBAL 4.x Compatibility Issues Fixed:

  • Fixed Cannot instantiate interface Doctrine\DBAL\Exception test error
  • Fixed Call to protected method connect() repository error
  • Updated package dependencies: Doctrine DBAL ^3.8 → ^4.0, PHPUnit ^10.5 → ^11.0

Related:

hetao29 and others added 15 commits May 5, 2024 08:20
…deprecated, the explicit nullable type must be used instead
…Int64

- Changed readInt64() to always return string instead of string|int
- Changed unpackUInt64() to always return string instead of string|int
- Changed readUInt64() return type to string for consistency
- Applied code style fixes with composer cs:fix
- Fixes failing tests: testShouldReadInt64 and testShouldPack64bit

Addresses maintainer feedback from PR krowinski#116 regarding MySQL 8.4.0 compatibility.
In DBAL 4.x, Doctrine\DBAL\Exception became an interface instead of a concrete class.
The test was trying to instantiate 'new Exception('')' which fails with
'Cannot instantiate interface Doctrine\DBAL\Exception'.

Fixed by using ConnectionException mock which implements the Exception interface,
preserving the exact same test logic and coverage as the original DBAL 3.x version.
Remove manual connection reconnection logic since DBAL 4.x handles
reconnection automatically. The connect() method became protected
in DBAL 4.x, causing 'Call to protected method' errors.

Changes:
- Removed manual ping/close/connect logic from getConnection()
- DBAL 4.x automatically handles lost connections and reconnection
- Kept ping() method as required by PingableConnection interface

This fixes the repository to work with DBAL 4.x while maintaining
the same functionality.
@cyppe
Copy link
Contributor Author

cyppe commented Jun 22, 2025

@krowinski please try to run tests and see if it passes.

@krowinski krowinski merged commit 635b8a5 into krowinski:master Jun 25, 2025
9 checks passed
@krowinski
Copy link
Owner

tx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants