Skip to content

Commit

Permalink
Fixed bug introduced by fix [0] and discussed [1].
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Mar 28, 2014
1 parent 10180f9 commit 475e666
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/lib/query/Join.php
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions test/testsuite/runtime/query/JoinTest.php
Expand Up @@ -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()
Expand Down

1 comment on commit 475e666

@stevleibelt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.