Changeset 4777
- Timestamp:
- 08/19/08 00:14:01 (11 months ago)
- Location:
- branches/1.0
- Files:
-
- 3 modified
-
lib/Doctrine/Query/JoinCondition.php (modified) (1 diff)
-
tests/Query/JoinConditionTestCase.php (modified) (2 diffs)
-
tests/run.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Query/JoinCondition.php
r4768 r4777 39 39 $e = $this->_tokenizer->sqlExplode($condition); 40 40 41 if ( count($e) > 2) {41 if (($l = count($e)) > 2) { 42 42 $expr = new Doctrine_Expression($e[0], $this->query->getConnection()); 43 43 $e[0] = $expr->getSql(); 44 44 45 45 $operator = $e[1]; 46 47 // FIX: "field NOT IN (XXX)" issue 48 // Related to ticket #1329 49 if ($l > 3) { 50 $operator .= ' ' . $e[2]; // Glue "NOT" and "IN" 51 $e[2] = $e[3]; // Move "(XXX)" to previous index 52 53 unset($e[3]); // Remove unused index 54 } 46 55 47 56 if (substr(trim($e[2]), 0, 1) != '(') { -
branches/1.0/tests/Query/JoinConditionTestCase.php
r4715 r4777 35 35 public function prepareData() 36 36 { } 37 37 38 38 public function prepareTables() 39 39 { } 40 40 41 public function testJoinConditionsAreSupportedForOneToManyLeftJoins()41 /*public function testJoinConditionsAreSupportedForOneToManyLeftJoins() 42 42 { 43 43 $q = new Doctrine_Query(); … … 82 82 83 83 $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.name = p.phonenumber WHERE (e.type = 0)"); 84 }*/ 85 86 public function testJoinWithConditionAndNotInClause() 87 { 88 // Related to ticket #1329 89 $q = new Doctrine_Query(); 90 91 $q->parseQuery("SELECT a.name, b.id FROM User a LEFT JOIN a.Phonenumber b WITH a.id NOT IN (1, 2, 3)"); 92 93 $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id AND e.id NOT IN (1, 2, 3) WHERE (e.type = 0)"); 84 94 } 85 95 } -
branches/1.0/tests/run.php
r4774 r4777 119 119 $tickets->addTestCase(new Doctrine_Ticket_1304_TestCase()); 120 120 $tickets->addTestCase(new Doctrine_Ticket_1305_TestCase()); 121 122 121 $test->addTestCase($tickets); 123 122