Changeset 6859

Show
Ignore:
Timestamp:
12/04/09 19:12:51 (8 months ago)
Author:
kriswallsmith
Message:

[1.2] fixed misplaced paren when parsing join condition

Location:
branches/1.2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.2/lib/Doctrine/Query/JoinCondition.php

    r6528 r6859  
    123123                    $rightExpr = (($hasRightAggExpression) ? $rightMatches[1] . '(' : '') 
    124124                              . $value 
    125                               . (($hasRightAggExpression) ? $rightMatches[3] . ')' : '') ; 
     125                              . (($hasRightAggExpression) ? ')' . $rightMatches[3] : '') ; 
    126126 
    127127                    $condition  = $leftExpr . ' ' . $operator . ' ' . $rightExpr; 
  • branches/1.2/tests/Ticket/1483TestCase.php

    r5901 r6859  
    5959 
    6060    } 
     61 
     62    public function testTest4() 
     63    { 
     64        $q = Doctrine_Query::create() 
     65            ->from('Ticket_1483_User u') 
     66            ->leftJoin('u.Groups g WITH g.id = (SELECT SUM(1, 2, 3) AS testing)'); 
     67        $this->assertEqual($q->getSqlQuery(), 'SELECT t.id AS t__id, t.username AS t__username, t2.id AS t2__id, t2.name AS t2__name FROM ticket_1483__user t LEFT JOIN ticket_1483__user_group t3 ON (t.id = t3.user_id) LEFT JOIN ticket_1483__group t2 ON t2.id = t3.group_id AND (t2.id = (SELECT SUM(1, 2, 3) AS testing))'); 
     68 
     69    } 
    6170} 
    6271