Skip to content

Populate indexed column lengths only with non-null values#6965

Merged
morozov merged 1 commit intodoctrine:4.3.xfrom
morozov:index-non-null-lengths
May 20, 2025
Merged

Populate indexed column lengths only with non-null values#6965
morozov merged 1 commit intodoctrine:4.3.xfrom
morozov:index-non-null-lengths

Conversation

@morozov
Copy link
Member

@morozov morozov commented May 20, 2025

This change is similar to #6964. If an index is constructed via IndexEditor, even if none of the indexed columns have the length specified, its $options will have a length element populated with nulls. This isn't a problem per se but may fail the results of comparison of the expected index constructed via new Index() and the actual constructed via IndexEditor.

Without the code change in IndexEditor, the rewritten test would fail.

On its own, the current behavior isn't right or wrong. The MySQL schema manager also populates all column lengths, even if they are null.

@morozov morozov added this to the 4.3.0 milestone May 20, 2025
@morozov morozov marked this pull request as ready for review May 20, 2025 17:01
@morozov morozov requested a review from greg0ire May 20, 2025 17:02
@morozov morozov merged commit d1fd897 into doctrine:4.3.x May 20, 2025
82 checks passed
@morozov morozov deleted the index-non-null-lengths branch May 20, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants