Not prefixing columns with table name creates invalid query #2599

Closed
zfbot opened this Issue Sep 28, 2012 · 1 comment

Comments

Projects
None yet
2 participants

zfbot commented Sep 28, 2012

Jira Information

Original Issue:ZF2-574
Issue Type:Bug
Reporter:robertbasic
Created:09/19/12
Assignee:ralphschindler
Components:Zend\Db

Description

The columns() method of Sql\Select has a second parameter $prefixColumnsWithTable. When that is set to false, an invalid query is created.

// in an AbstractTableGateway
$select = $this->select();
$select->from('my_table')
    ->columns(array('column1'), false);

Expected query: SELECT "column1" FROM "my_table"

Actual query: SELECT ."column1" FROM "my_table"

Using PDO_Mysql.

zfbot commented Sep 28, 2012

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF2-574

Known GitHub users mentioned in the original message or comment:
@robertbasic, @ralphschindler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment