CDbQueryBuilder text is not updated after changing select

  $command = Yii::app()->db->createCommand()				




  $count= $command->queryScalar();		


  $text = $command->text; //Text is still 'COUNT(*) FROM foo

In CDbCommand you will find, which explains this behavior:

	public function getText()


		if($this->_text=='' && !empty($this->_query))


		return $this->_text;



$command->text = '';

$text = $command->text; //Text is updated with latest select statement

Shouldn’t this be changed in Yii core?

Check the documentation -

Thanks, but reset() is not really an option for me, because the point of just changing the select statement is to keep all other query settings.