Skip to content

Comparator incorrectly diffs default values (regression in master) #3336

@Majkl578

Description

@Majkl578

BC Break Report

Q A
BC Break yes
Version 2.9.0-dev

Summary

After applying Doctrine CS 5.0, weak comparisons became strict comparisons.
One of the affected places is Comparator which compares default values as is (always string|null from the DB while it's scalar|null when declared in ORM):

if ($properties1['default'] !== $properties2['default'] ||

Previous behaviour

The following test works with snapshot/develop/2018-04-17
https://github.com/doctrine/doctrine2/blob/2726636e55fdbdf6fb1ed466f22d34de116fb8f9/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php#L24-L41

Current behavior

Comparator now produces diff SQL when default is (int) 0.

How to reproduce

Run ORM 2.6 test suite with DBAL 2.9.0-dev.
https://travis-ci.org/doctrine/doctrine2/jobs/448657137#L608

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions