Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0 beta4 - Fix DDC 629 #9

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.properties.dev
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 8 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<dependencies>
<php minimum_version="5.3.2" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="2.0.0BETA4" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="${dependencies.common}" />
</dependencies>
<dirroles key="bin">script</dirroles>
<ignore>Doctrine/Common/</ignore>
Expand All @@ -174,9 +174,12 @@
</target>

<target name="git-tag">
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/DBAL/Version.php" checkreturn="true"/>
<exec command="grep '${version}-DEV' ${project.basedir}/lib/Doctrine/DBAL/Version.php" checkreturn="true"/>
<exec command="sed 's/${version}-DEV/${version}/' ${project.basedir}/lib/Doctrine/DBAL/Version.php > ${project.basedir}/lib/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/DBAL/Version2.php ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git commit -m 'Release {$version}'" />
<exec command="git tag -a ${version}" passthru="true" />
<exec command="git push origin ${version}" passthru="true" />
</target>

<target name="pirum-release">
Expand All @@ -191,11 +194,10 @@
<target name="update-dev-version">
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/DBAL/Version.php" checkreturn="true"/>
<propertyprompt propertyName="next_version" defaultValue="${version}" promptText="Enter next version string (without -DEV)" />
<exec command="sed 's/${version}-DEV/${next_version}-DEV/' ${project.basedir}/lib/Doctrine/DBAL/Version.php > ${project.basedir}/lib/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="sed 's/${version}/${next_version}-DEV/' ${project.basedir}/lib/Doctrine/DBAL/Version.php > ${project.basedir}/lib/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/DBAL/Version2.php ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git commit -m 'Bump Dev Version to ${next_version}'" passthru="true" />
<exec command="git push origin master" passthru="true" />
<exec command="git commit -m 'Bump Dev Version to ${next_version}-DEV'" passthru="true" />
</target>

<target name="release" depends="git-tag,build-packages,distribute-download,pirum-release,update-dev-version" />
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 15 additions & 4 deletions lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/vendor/doctrine-common
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Types\Type;
use PDO;

require_once __DIR__ . '/../../TestInit.php';

Expand All @@ -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) . ")";
Expand Down