Commit 1e664156 authored by romanb's avatar romanb

[2.0][DDC-368] Fixed.

parent cbd81333
...@@ -152,7 +152,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor ...@@ -152,7 +152,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
// Execute UPDATE statements // Execute UPDATE statements
for ($i=0, $count=count($this->_sqlStatements); $i<$count; ++$i) { for ($i=0, $count=count($this->_sqlStatements); $i<$count; ++$i) {
$conn->executeUpdate($this->_sqlStatements[$i], $this->_sqlParameters[$i]); $conn->executeUpdate($this->_sqlStatements[$i], isset($this->_sqlParameters[$i]) ? $this->_sqlParameters[$i] : array());
} }
// Drop temporary table // Drop temporary table
......
...@@ -71,7 +71,6 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase ...@@ -71,7 +71,6 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->clear(); $this->_em->clear();
//TODO: Test bulk UPDATE
$query = $this->_em->createQuery("update Doctrine\Tests\Models\Company\CompanyEmployee p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); $query = $this->_em->createQuery("update Doctrine\Tests\Models\Company\CompanyEmployee p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
$query->setParameter(1, 'NewName'); $query->setParameter(1, 'NewName');
$query->setParameter(2, 'NewDepartment'); $query->setParameter(2, 'NewDepartment');
...@@ -275,4 +274,18 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase ...@@ -275,4 +274,18 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertFalse($mainEvent instanceof \Doctrine\ORM\Proxy\Proxy); $this->assertFalse($mainEvent instanceof \Doctrine\ORM\Proxy\Proxy);
} }
/**
* @group DDC-368
*/
public function testBulkUpdateIssueDDC368()
{
$dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyEmployee AS p SET p.salary = 1';
$this->_em->createQuery($dql)->execute();
$this->assertTrue(count($this->_em->createQuery(
'SELECT count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p WHERE p.salary = 1')
->getResult()) > 0);
}
} }
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