Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/issue-2599' of git://github.com/robertbasic/zf2 …
Browse files Browse the repository at this point in the history
…into robertbasic-hotfix/issue-2599
  • Loading branch information
Ralph Schindler committed Oct 9, 2012
2 parents bce7ef3 + ab11948 commit f9620ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Db/Sql/Select.php
Expand Up @@ -533,7 +533,7 @@ protected function processSelect(PlatformInterface $platform, Adapter $adapter =
$fromTable = ($this->prefixColumnsWithTable) ? $table : '';
}

$fromTable .= $platform->getIdentifierSeparator();
$fromTable .= ($this->prefixColumnsWithTable) ? $platform->getIdentifierSeparator() : '';

// process table columns
$columns = array();
Expand Down
14 changes: 14 additions & 0 deletions tests/ZendTest/Db/Sql/SelectTest.php
Expand Up @@ -470,6 +470,20 @@ public function testProcessMethods(Select $select, $unused, $unused2, $unused3,
}
}

/**
* @autor robertbasic
* @group issue2599
* @testdox unit test: Not prefixing columns with table will create a valid query
*/
public function testNotPrefixingColumnsWithTableNameCreatesValidQuery()
{
$select = new Select;
$select->from('foo')
->columns(array('bar'), false);

$this->assertEquals('SELECT "bar" AS "bar" FROM "foo"', $select->getSqlString());
}

public function providerData()
{
// basic table
Expand Down

0 comments on commit f9620ac

Please sign in to comment.