yiisoft/yii — Issue #378: ActiveRecord findAll cross tables build sql bug,  when using limit or offset
Author: taojoe
Created: 2012-02-21 07:18:00+00:00
State: open

version 1.1.10,
file framework/db/ar/CActiveFinder.php, line 802.

scenario:
I use CDbCriteria->with query across another table, when i set limit, the sql output with debug is wrong, the join table part is lost.
so I debuged it,find that at when CActiveFinder build sql, if there is limit setting, it stoped building join part.

change the line from:
|| $this->_finder->joinAll || $child->relation->together || (!$this->_finder->baseLimited && $child->relation->together===null))

to:
|| $this->_finder->joinAll || $child->relation->together || $child->relation->together===null)

will fix this.