diff --git a/build.properties.dev b/build.properties.dev index f571318824e..7b8ca3449d0 100644 --- a/build.properties.dev +++ b/build.properties.dev @@ -1,4 +1,5 @@ -version_name=2.0.0BETA3 +version_name=2.0.1 +dependencies.common=2.0.1 stability=beta build.dir=build dist.dir=dist diff --git a/build.xml b/build.xml index c28028461bd..4c1f23d2c4f 100644 --- a/build.xml +++ b/build.xml @@ -154,7 +154,7 @@ - + script Doctrine/Common/ @@ -174,9 +174,12 @@ - + + + + + - @@ -191,11 +194,10 @@ - + - - + diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 1bf7ff70a95..b56adf8c167 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -1007,7 +1007,7 @@ private function _bindTypedValues($stmt, array $params, array $types) // Check whether parameters are positional or named. Mixing is not allowed, just like in PDO. if (is_int(key($params))) { // Positional parameters - $typeOffset = isset($types[0]) ? -1 : 0; + $typeOffset = array_key_exists(0, $types) ? -1 : 0; $bindIndex = 1; foreach ($params as $position => $value) { $typeIndex = $bindIndex + $typeOffset; diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index f85dc667b7a..44f0e42aa7e 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -201,9 +201,20 @@ public function listTableNames() * * @return Table[] */ - public function listTables() + public function listTables($classes) { - $tableNames = $this->listTableNames(); + if(!empty($classes)){ + + foreach($classes as $class){ + $tableNames[] = $class->table['name']; + foreach($class->associationMappings as $associationMapping) + if($associationMapping['isOwningSide'] && array_key_exists('joinTable', $associationMapping) && !\is_null($associationMapping['joinTable']['name'])) + $tableNames[] = $associationMapping['joinTable']['name']; + } + + } else { + $tableNames = $this->listTableNames(); + } $tables = array(); foreach ($tableNames AS $tableName) { @@ -751,13 +762,13 @@ protected function _execSql($sql) * * @return Schema */ - public function createSchema() + public function createSchema(array $classes = null) { $sequences = array(); if($this->_platform->supportsSequences()) { $sequences = $this->listSequences(); } - $tables = $this->listTables(); + $tables = $this->listTables($classes); return new Schema($tables, $sequences, $this->createSchemaConfig()); } diff --git a/lib/Doctrine/DBAL/Version.php b/lib/Doctrine/DBAL/Version.php index 1b99e5ce9c2..98e5e91d5b0 100644 --- a/lib/Doctrine/DBAL/Version.php +++ b/lib/Doctrine/DBAL/Version.php @@ -36,7 +36,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.0.0-DEV'; + const VERSION = '2.0.1'; /** * Compares a Doctrine version with the current one. diff --git a/lib/vendor/doctrine-common b/lib/vendor/doctrine-common index a46c6180f96..9d414673bb0 160000 --- a/lib/vendor/doctrine-common +++ b/lib/vendor/doctrine-common @@ -1 +1 @@ -Subproject commit a46c6180f96647fdd66e2c8f2771d61ecebe6a3f +Subproject commit 9d414673bb007e61977341d78745fc5aa316a92b diff --git a/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php b/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php index a834bbe042e..76873cec1d8 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\DBAL\Functional; use Doctrine\DBAL\Types\Type; +use PDO; require_once __DIR__ . '/../../TestInit.php'; @@ -25,6 +26,18 @@ public function setUp() $this->_conn->executeUpdate('DELETE FROM write_table'); } + /** + * @group DBAL-80 + */ + public function testExecuteUpdateFirstTypeIsNull() + { + $sql = "INSERT INTO write_table (test_string, test_int) VALUES (?, ?)"; + $this->_conn->executeUpdate($sql, array("text", 1111), array(null, PDO::PARAM_INT)); + + $sql = "SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"; + $this->assertTrue((bool)$this->_conn->fetchColumn($sql, array("text", 1111))); + } + public function testExecuteUpdate() { $sql = "INSERT INTO write_table (test_int) VALUES ( " . $this->_conn->quote(1) . ")";