-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix length type in MySQLSchemaManager with ATTR_STRINGIFY_FETCHES enabled
#7028
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
derrabus
merged 8 commits into
doctrine:4.3.x
from
keulinho:fix-mysql-schema-manager-length-types
Jul 22, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
681684a
fix: Fix length type in MySQLSchemaManager
keulinho 75112ec
remove varchar test
keulinho 1d0017c
Fix decimal types
keulinho 06583a3
Add separat job for stringify fetches
keulinho ca859c0
Fix QueryBuilderTest with PDO_stringify_fetches
keulinho 3f97ef9
Debug connection params in test
keulinho 75e50a3
fix debug statement
keulinho 2426ab3
Remove debug
keulinho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd" | ||
| colors="true" | ||
| beStrictAboutOutputDuringTests="true" | ||
| failOnRisky="true" | ||
| failOnWarning="true" | ||
| failOnNotice="true" | ||
| failOnPhpunitDeprecation="true" | ||
| displayDetailsOnTestsThatTriggerErrors="true" | ||
| displayDetailsOnTestsThatTriggerDeprecations="true" | ||
| > | ||
| <php> | ||
| <ini name="error_reporting" value="-1" /> | ||
|
|
||
| <var name="db_driver" value="pdo_mysql"/> | ||
| <!-- see \PDO::ATTR_STRINGIFY_FETCHES--> | ||
| <var name="db_driver_option_17" value="true"/> | ||
| <var name="db_host" value="127.0.0.1" /> | ||
| <var name="db_port" value="3306"/> | ||
| <var name="db_user" value="root" /> | ||
| <var name="db_dbname" value="doctrine_tests" /> | ||
| <var name="db_charset" value="utf8mb4" /> | ||
| </php> | ||
|
|
||
| <testsuites> | ||
| <testsuite name="Doctrine DBAL Test Suite"> | ||
| <directory>../../../tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
|
|
||
| <source> | ||
| <include> | ||
| <directory>../../../src</directory> | ||
| </include> | ||
| </source> | ||
| </phpunit> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| use Doctrine\DBAL\Tests\FunctionalTestCase; | ||
| use Doctrine\DBAL\Tests\TestUtil; | ||
| use Doctrine\DBAL\Types\Types; | ||
| use PDO; | ||
|
|
||
| use function array_change_key_case; | ||
|
|
||
|
|
@@ -555,24 +556,21 @@ public function testPlatformDoesNotSupportCTE(): void | |
| */ | ||
| private function prepareExpectedRows(array $rows): array | ||
| { | ||
| if (! TestUtil::isDriverOneOf('ibm_db2', 'pdo_oci', 'pdo_sqlsrv', 'oci8')) { | ||
| return $rows; | ||
| } | ||
|
|
||
| if (! TestUtil::isDriverOneOf('ibm_db2')) { | ||
| if ( | ||
| TestUtil::isDriverOneOf('pdo_oci', 'pdo_sqlsrv', 'oci8') | ||
| || (TestUtil::getConnectionParams()['driverOptions'][PDO::ATTR_STRINGIFY_FETCHES] ?? false) === true | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I intentionally did not check for |
||
| ) { | ||
| foreach ($rows as &$row) { | ||
| foreach ($row as &$value) { | ||
| $value = (string) $value; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (! TestUtil::isDriverOneOf('ibm_db2', 'pdo_oci', 'oci8')) { | ||
| return $rows; | ||
| } | ||
|
|
||
| foreach ($rows as &$row) { | ||
| $row = array_change_key_case($row, CASE_UPPER); | ||
| if (TestUtil::isDriverOneOf('ibm_db2', 'pdo_oci', 'oci8')) { | ||
| foreach ($rows as &$row) { | ||
| $row = array_change_key_case($row, CASE_UPPER); | ||
| } | ||
| } | ||
|
|
||
| return $rows; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This took quite some time for me to understand all the negated ifs, IMHO keeping the flow as straight forward as possible makes it easier to understand what is going on