Skip to content

Commit e914de6

Browse files
committed
Merge pull request #854 from stevleibelt/master
Fixed bug introduced by fix [0] and discussed [1].
2 parents 10180f9 + 475e666 commit e914de6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

runtime/lib/query/Join.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,14 @@ public function getClause(&$params)
563563
*/
564564
public function equals($join)
565565
{
566+
$parametersOfThisClauses = array();
567+
$parametersOfJoinClauses = array();
568+
566569
return $join !== null
567570
&& $join instanceof Join
568571
&& $this->getJoinType() == $join->getJoinType()
569-
&& $this->getConditions() == $join->getConditions();
572+
&& $this->getConditions() == $join->getConditions()
573+
&& $this->getClause($parametersOfThisClauses) == $join->getClause($parametersOfJoinClauses);
570574
}
571575

572576
/**

test/testsuite/runtime/query/JoinTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ public function testEquality()
186186
$j7 = new Join('foo', 'bar', 'INNER JOIN');
187187
$this->assertTrue($j5->equals($j7), 'Join without specified join type should be equal
188188
to INNER JOIN, as it fallback to default join type');
189+
190+
$j8 = new Join('foo', 'bar', 'INNER JOIN');
191+
$j8->addCondition('baz.foo', 'baz.bar');
192+
$this->assertFalse($j5->equals($j8));
189193
}
190194

191195
public function testCountConditions()

0 commit comments

Comments
 (0)