Browse files

Fixed bug introduced by fix [0] and discussed [1].

  • Loading branch information...
1 parent 10180f9 commit 475e666cfae520e561324855484e641e58d810b9 @stevleibelt stevleibelt committed Mar 28, 2014
Showing with 9 additions and 1 deletion.
  1. +5 −1 runtime/lib/query/Join.php
  2. +4 −0 test/testsuite/runtime/query/JoinTest.php
View
6 runtime/lib/query/Join.php
@@ -563,10 +563,14 @@ public function getClause(&$params)
*/
public function equals($join)
{
+ $parametersOfThisClauses = array();
+ $parametersOfJoinClauses = array();
+
return $join !== null
&& $join instanceof Join
&& $this->getJoinType() == $join->getJoinType()
- && $this->getConditions() == $join->getConditions();
+ && $this->getConditions() == $join->getConditions()
+ && $this->getClause($parametersOfThisClauses) == $join->getClause($parametersOfJoinClauses);
}
/**
View
4 test/testsuite/runtime/query/JoinTest.php
@@ -186,6 +186,10 @@ public function testEquality()
$j7 = new Join('foo', 'bar', 'INNER JOIN');
$this->assertTrue($j5->equals($j7), 'Join without specified join type should be equal
to INNER JOIN, as it fallback to default join type');
+
+ $j8 = new Join('foo', 'bar', 'INNER JOIN');
+ $j8->addCondition('baz.foo', 'baz.bar');
+ $this->assertFalse($j5->equals($j8));
}
public function testCountConditions()

1 comment on commit 475e666

@stevleibelt

comment should be like in #854:
Fixed bug introduced by commit dcace44 and discussed #641 (comment).

Please sign in to comment.