Skip to content
Browse files

Merge branch 'hotfix/issue-2599' of git://github.com/robertbasic/zf2 …

…into robertbasic-hotfix/issue-2599
  • Loading branch information...
2 parents bce7ef3 + ab11948 commit f9620ac389030d0707adeda676029dd8e5895925 @ralphschindler ralphschindler committed
Showing with 15 additions and 1 deletion.
  1. +1 −1 library/Zend/Db/Sql/Select.php
  2. +14 −0 tests/ZendTest/Db/Sql/SelectTest.php
View
2 library/Zend/Db/Sql/Select.php
@@ -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();
View
14 tests/ZendTest/Db/Sql/SelectTest.php
@@ -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

0 comments on commit f9620ac

Please sign in to comment.
Something went wrong with that request. Please try again.