-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Db/Sql/Predicate/Expression: Fix method argument handling #6849
Db/Sql/Predicate/Expression: Fix method argument handling #6849
Conversation
Pittiplatsch
commented
Nov 6, 2014
- Fix method argument handling of Predicate/Expression to allow single non-scalar values (e.g. null, Predicate instances) as only parameter
- Fix typo in Predicate/Predicate
non-scalar values (e.g. null, Predicate instances) as only parameter * Fix typo in Predicate/Predicate
@@ -57,10 +139,4 @@ public function testRetrievingWherePartsReturnsSpecificationArrayOfLiteralAndPar | |||
$test = $expression->getExpressionData(); | |||
$this->assertEquals($expected, $test, var_export($test, 1)); | |||
} | |||
|
|||
public function testAllowZeroParameterValue() |
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.
Since this test was changed/removed: should I assume there is a BC break?
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.
Test is replaced with testCanPassSingleZeroParameterValueToConstructor()
.
The 0
part is the important, tested one, where 'foo.bar > ?'
is actually irrelevant for this test.
Thus: no BC
@Pittiplatsch merged and applied minor tweaks, thanks! |
The changes introduced a BC break! The $valueParameter argument in the constructor has the default value null, which in the old code meant that the provided expression has no parameters. Now the new code treats this null as a query parameter and therefore the old queries fail due to this!
P.S. The Sql\Expression class handles this case still the old way - as it should, without BC break. |