Commit 3a282b1e authored by romanb's avatar romanb

[2.0][DDC-141] Fixed.

parent fa99b944
...@@ -1115,9 +1115,7 @@ class SqlWalker implements TreeWalker ...@@ -1115,9 +1115,7 @@ class SqlWalker implements TreeWalker
$discrSql = $this->_generateDiscriminatorColumnConditionSql($this->_currentRootAlias); $discrSql = $this->_generateDiscriminatorColumnConditionSql($this->_currentRootAlias);
if ($discrSql) { if ($discrSql) {
if ($termsSql) $sql .= ' AND'; $sql .= ' AND ' . $discrSql;
$sql .= ' ' . $discrSql;
} }
return $sql; return $sql;
......
...@@ -22,8 +22,6 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase ...@@ -22,8 +22,6 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\RelatedEntity') $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\RelatedEntity')
)); ));
} catch (\Exception $e) { } catch (\Exception $e) {
var_dump($e->getMessage());
var_dump($e->getTraceAsString());
// Swallow all exceptions. We do not test the schema tool here. // Swallow all exceptions. We do not test the schema tool here.
} }
} }
...@@ -94,7 +92,28 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase ...@@ -94,7 +92,28 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query = $this->_em->createQuery("delete Doctrine\Tests\ORM\Functional\ParentEntity e"); $query = $this->_em->createQuery("delete Doctrine\Tests\ORM\Functional\ParentEntity e");
$affected = $query->execute(); $affected = $query->execute();
$this->assertEquals(2, $affected); $this->assertEquals(2, $affected);
$this->_em->clear();
// DQL query with WHERE clause
$child = new ChildEntity;
$child->setData('thedata');
$child->setNumber(1234);
$this->_em->persist($child);
$this->_em->flush();
$this->_em->clear();
$query = $this->_em->createQuery('select e from Doctrine\Tests\ORM\Functional\ParentEntity e where e.id=?1');
$query->setParameter(1, $child->getId());
$child2 = $query->getSingleResult();
$this->assertTrue($child2 instanceof ChildEntity);
$this->assertEquals('thedata', $child2->getData());
$this->assertEquals(1234, $child2->getNumber());
$this->assertEquals($child->getId(), $child2->getId());
$this->assertFalse($child === $child2);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment