Commit 09b00c5c by Qiang Xue

Reverted #4098.

parent 992a4380
...@@ -121,7 +121,6 @@ Yii Framework 2 Change Log ...@@ -121,7 +121,6 @@ Yii Framework 2 Change Log
- Added note about the fact that intl is required for non-latin languages to requirements checker. - Added note about the fact that intl is required for non-latin languages to requirements checker.
- Enh #4028: Added ability to `yii\widgets\Menu` to encode each item's label separately (creocoder, umneeq) - Enh #4028: Added ability to `yii\widgets\Menu` to encode each item's label separately (creocoder, umneeq)
- Enh #4080: Added proper handling and support of the symlinked directories in `FileHelper`, added $options parameter in `FileHelper::removeDirectory()` (resurtm) - Enh #4080: Added proper handling and support of the symlinked directories in `FileHelper`, added $options parameter in `FileHelper::removeDirectory()` (resurtm)
- Enh #4098: `yii\db\Query::addSelect()` should include `*` when it is called the first time (qiangxue)
- Enh: Added support for using sub-queries when building a DB query with `IN` condition (qiangxue) - Enh: Added support for using sub-queries when building a DB query with `IN` condition (qiangxue)
- Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue) - Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
- Enh: Added `yii\web\UrlManager::addRules()` to simplify adding new URL rules (qiangxue) - Enh: Added `yii\web\UrlManager::addRules()` to simplify adding new URL rules (qiangxue)
......
...@@ -417,9 +417,6 @@ class Query extends Component implements QueryInterface ...@@ -417,9 +417,6 @@ class Query extends Component implements QueryInterface
$columns = preg_split('/\s*,\s*/', trim($columns), -1, PREG_SPLIT_NO_EMPTY); $columns = preg_split('/\s*,\s*/', trim($columns), -1, PREG_SPLIT_NO_EMPTY);
} }
if ($this->select === null) { if ($this->select === null) {
if (!in_array('*', $columns)) {
array_unshift($columns, '*');
}
$this->select = $columns; $this->select = $columns;
} else { } else {
$this->select = array_merge($this->select, $columns); $this->select = array_merge($this->select, $columns);
......
...@@ -27,7 +27,7 @@ class QueryTest extends DatabaseTestCase ...@@ -27,7 +27,7 @@ class QueryTest extends DatabaseTestCase
$query = new Query(); $query = new Query();
$query->addSelect('email'); $query->addSelect('email');
$this->assertEquals(['*', 'email'], $query->select); $this->assertEquals(['email'], $query->select);
$query = new Query(); $query = new Query();
$query->select('id, name'); $query->select('id, name');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment