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 GH-11587 PHP8.1: Fixed the condition for result set values to be of native type, making it compatible with previous versions. #11622

Conversation

SakiTakamachi
Copy link
Member

@SakiTakamachi SakiTakamachi commented Jul 7, 2023

Issue: #11587
Original PR: #11616

PDO::ATTR_EMULATE_PREPARES = true
PDO::ATTR_STRINGIFY_FETCHES = true

Fixed a problem in which the float(M, D) type and double(M, D) type values retrieved from mysql changed between php8.0 or earlier and 8.1 or later when the above conditions were met.

Please see issue for details.

@SakiTakamachi SakiTakamachi marked this pull request as ready for review July 8, 2023 02:25
@SakiTakamachi SakiTakamachi changed the title PHP8.1: Fixed the condition for result set values to be of native type, making it compatible with previous versions. fix gh-11587 PHP8.1: Fixed the condition for result set values to be of native type, making it compatible with previous versions. Jul 8, 2023
@SakiTakamachi SakiTakamachi changed the title fix gh-11587 PHP8.1: Fixed the condition for result set values to be of native type, making it compatible with previous versions. FIX GH-11587 PHP8.1: Fixed the condition for result set values to be of native type, making it compatible with previous versions. Jul 8, 2023
@youkidearitai
Copy link
Contributor

@Girgias @iluuu1994 I think make sense to me. Could you review to this PR?

@iluuu1994
Copy link
Member

I'm not personally familiar with the pdo extension...

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, but please address the comments.

ext/pdo_mysql/tests/gh-11587.phpt Outdated Show resolved Hide resolved
ext/pdo_mysql/mysql_driver.c Outdated Show resolved Hide resolved
ext/pdo_mysql/mysql_driver.c Outdated Show resolved Hide resolved
@SakiTakamachi
Copy link
Member Author

@iluuu1994
Thank you for your confirmation!

@Girgias
Thank you for your review. I will make the necessary corrections to the mentioned areas (including the other 'return false') and fix the inappropriate test skipping that caused the failing tests.

@SakiTakamachi
Copy link
Member Author

@Girgias
Fix completed.

@Girgias Girgias self-assigned this Jul 14, 2023
@SakiTakamachi
Copy link
Member Author

I fixed the skipif in the test.
Because there was no need to see the mysqli loading at all in the skipif of this test.

@Girgias Girgias closed this in e0aadc1 Jul 17, 2023
@SakiTakamachi
Copy link
Member Author

Thank you!

@GrahamCampbell
Copy link
Contributor

GrahamCampbell commented Aug 3, 2023

This seems to be a breaking change, causing issues for Laravel. I would propose to revert this, and possibly only make this change in PHP 8.3. See laravel/framework#47937.

@Girgias
Copy link
Member

Girgias commented Aug 3, 2023

This seems to be a breaking change, causing issues for Laravel. I would propose to revert this, and possibly only make this change in PHP 8.3. See laravel/framework#47937.

Please open a new issue and reference this PR instead of commenting on and old closed PR

@esetnik
Copy link

esetnik commented Aug 20, 2023

@GrahamCampbell did you ever end up opening a new issue for this? We are hitting the breaking change bug in laravel/framework#47937 as well.

@GrahamCampbell
Copy link
Contributor

No, please go ahead yourself.

@SakiTakamachi SakiTakamachi deleted the fix/result-sets-when-stringify-to-8.1 branch August 24, 2023 13:07
@josuechevezUEES
Copy link

I have the same issue in Laravel. I'm using Laravel Sail, and Docker doesn't allow me to change the PHP version from 8.2.9 to 8.2.8. Has anyone managed to do it?

@SakiTakamachi
Copy link
Member Author

@josuechevezUEES

Downgrading will be difficult unless you build php from source.

Until this issue is resolved, I recommend using my Laravel library.

https://github.com/SakiTakamachi/laravel-sqlsrv-err-avoid

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.

7 participants