Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
d3d936e4
Unverified
Commit
d3d936e4
authored
Dec 04, 2018
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted strict comparison back to loose because of a new regression
parent
9d382e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+1
-1
phpcs.xml.dist
phpcs.xml.dist
+5
-0
ComparatorTest.php
.../Doctrine/Tests/DBAL/Functional/Schema/ComparatorTest.php
+19
-3
No files found.
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
d3d936e4
...
...
@@ -435,7 +435,7 @@ class Comparator
// Null values need to be checked additionally as they tell whether to create or drop a default value.
// null != 0, null != false, null != '' etc. This affects platform's table alteration SQL generation.
if
((
$properties1
[
'default'
]
===
null
)
!==
(
$properties2
[
'default'
]
===
null
)
||
(
string
)
$properties1
[
'default'
]
!==
(
string
)
$properties2
[
'default'
])
{
||
$properties1
[
'default'
]
!=
$properties2
[
'default'
])
{
$changedProperties
[]
=
'default'
;
}
...
...
phpcs.xml.dist
View file @
d3d936e4
...
...
@@ -58,4 +58,9 @@
<exclude-pattern>
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
</exclude-pattern>
<exclude-pattern>
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
</exclude-pattern>
</rule>
<!-- see https://github.com/doctrine/dbal/issues/3377 -->
<rule
ref=
"SlevomatCodingStandard.ControlStructures.DisallowEqualOperators.DisallowedNotEqualOperator"
>
<exclude-pattern>
lib/Doctrine/DBAL/Schema/Comparator.php
</exclude-pattern>
</rule>
</ruleset>
tests/Doctrine/Tests/DBAL/Functional/Schema/ComparatorTest.php
View file @
d3d936e4
...
...
@@ -25,15 +25,31 @@ class ComparatorTest extends DbalFunctionalTestCase
$this
->
comparator
=
new
Comparator
();
}
public
function
testDefaultValueComparison
()
/**
* @param mixed $value
*
* @dataProvider defaultValueProvider
*/
public
function
testDefaultValueComparison
(
string
$type
,
$value
)
:
void
{
$table
=
new
Table
(
'default_value'
);
$table
->
addColumn
(
'
id'
,
'integer'
,
[
'default'
=>
1
]);
$table
->
addColumn
(
'
test'
,
$type
,
[
'default'
=>
$value
]);
$this
->
schemaManager
->
c
reateTable
(
$table
);
$this
->
schemaManager
->
dropAndC
reateTable
(
$table
);
$onlineTable
=
$this
->
schemaManager
->
listTableDetails
(
'default_value'
);
self
::
assertFalse
(
$this
->
comparator
->
diffTable
(
$table
,
$onlineTable
));
}
/**
* @return mixed[][]
*/
public
static
function
defaultValueProvider
()
:
iterable
{
return
[
[
'integer'
,
1
],
[
'boolean'
,
false
],
];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment