title: CActiveDataProvider returns no data at all, only structure
body: <p>So, I'm a bit new with yii, I'm very sorry if this sounds like a lame question but I have some weird behavior. I'm trying to load a blog post with the comments but the actionView returns only the blog post:</p>
  
  <pre><code>    public function actionView($id)
      {
             $model = $this-&gt;loadModel($id);
             $criteria = new CDbCriteria;
             $criteria-&gt;condition = 'postId = ' . $id;
             $criteria-&gt;order = 'commentTime desc';
             $criteria-&gt;with = array('user');
             $dataSet = new CActiveDataProvider('Comments', array(
               'criteria' =&gt; $criteria,
              )
             );
             echo "&lt;pre&gt;";
             print_r($dataSet);
             echo "&lt;/pre&gt;";
             $this-&gt;render('view',array(
                      'model'=&gt;$model,
                      'dataSet'=&gt;$dataSet,
  
              ));
      }
  </code></pre>
  
  <p>Now the view file:</p>
  
  <pre><code>$this-&gt;renderPartial('_view',array('data'=&gt;$model,));
  $this-&gt;renderPartial('comments',array('data'=&gt;$dataSet,));
  </code></pre>
  
  <p>The funny thing is that according to the logs, it's not even selecting from the comments table, but when I print_r, I get the whole structure of the table.</p>
  
  <pre><code>CActiveDataProvider Object
  (
      [modelClass] =&gt; Comments
      [model] =&gt; Comments Object
          (
              [_md:CActiveRecord:private] =&gt; CActiveRecordMetaData Object
                  (
                      [tableSchema] =&gt; CMysqlTableSchema Object
                          (
                              [schemaName] =&gt; 
                              [name] =&gt; Comments
                              [rawName] =&gt; `Comments`
                              [primaryKey] =&gt; id
                              [sequenceName] =&gt; 
                              [foreignKeys] =&gt; Array
                                  (
                                      [postId] =&gt; Array
                                          (
                                              [0] =&gt; Posts
                                              [1] =&gt; id
                                          )
  
                                      [userId] =&gt; Array
                                          (
                                              [0] =&gt; users
                                              [1] =&gt; id
                                          )
  
                                  )
  
                              [columns] =&gt; Array
                                  (
                                      [id] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; id
                                              [rawName] =&gt; `id`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; int(11)
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 
                                              [size] =&gt; 11
                                              [precision] =&gt; 11
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 1
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 1
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [postId] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; postId
                                              [rawName] =&gt; `postId`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; int(11)
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 
                                              [size] =&gt; 11
                                              [precision] =&gt; 11
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 1
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [userId] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; userId
                                              [rawName] =&gt; `userId`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; int(11)
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 
                                              [size] =&gt; 11
                                              [precision] =&gt; 11
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 1
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [commentTime] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; commentTime
                                              [rawName] =&gt; `commentTime`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; timestamp
                                              [type] =&gt; string
                                              [defaultValue] =&gt; 
                                              [size] =&gt; 
                                              [precision] =&gt; 
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [commentText] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; commentText
                                              [rawName] =&gt; `commentText`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; mediumtext
                                              [type] =&gt; string
                                              [defaultValue] =&gt; 
                                              [size] =&gt; 
                                              [precision] =&gt; 
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [voteUp] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; voteUp
                                              [rawName] =&gt; `voteUp`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; mediumint(8) unsigned
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 0
                                              [size] =&gt; 8
                                              [precision] =&gt; 8
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [voteDown] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; voteDown
                                              [rawName] =&gt; `voteDown`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; mediumint(8) unsigned
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 0
                                              [size] =&gt; 8
                                              [precision] =&gt; 8
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                      [reports] =&gt; CMysqlColumnSchema Object
                                          (
                                              [name] =&gt; reports
                                              [rawName] =&gt; `reports`
                                              [allowNull] =&gt; 
                                              [dbType] =&gt; smallint(5) unsigned
                                              [type] =&gt; integer
                                              [defaultValue] =&gt; 0
                                              [size] =&gt; 5
                                              [precision] =&gt; 5
                                              [scale] =&gt; 
                                              [isPrimaryKey] =&gt; 
                                              [isForeignKey] =&gt; 
                                              [autoIncrement] =&gt; 
                                              [_e:CComponent:private] =&gt; 
                                              [_m:CComponent:private] =&gt; 
                                          )
  
                                  )
  
                              [_e:CComponent:private] =&gt; 
                              [_m:CComponent:private] =&gt; 
                          )
  
                      [columns] =&gt; Array
                          (
                              [id] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; id
                                      [rawName] =&gt; `id`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; int(11)
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 
                                      [size] =&gt; 11
                                      [precision] =&gt; 11
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 1
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 1
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [postId] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; postId
                                      [rawName] =&gt; `postId`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; int(11)
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 
                                      [size] =&gt; 11
                                      [precision] =&gt; 11
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 1
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [userId] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; userId
                                      [rawName] =&gt; `userId`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; int(11)
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 
                                      [size] =&gt; 11
                                      [precision] =&gt; 11
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 1
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [commentTime] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; commentTime
                                      [rawName] =&gt; `commentTime`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; timestamp
                                      [type] =&gt; string
                                      [defaultValue] =&gt; 
                                      [size] =&gt; 
                                      [precision] =&gt; 
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [commentText] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; commentText
                                      [rawName] =&gt; `commentText`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; mediumtext
                                      [type] =&gt; string
                                      [defaultValue] =&gt; 
                                      [size] =&gt; 
                                      [precision] =&gt; 
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [voteUp] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; voteUp
                                      [rawName] =&gt; `voteUp`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; mediumint(8) unsigned
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 0
                                      [size] =&gt; 8
                                      [precision] =&gt; 8
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [voteDown] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; voteDown
                                      [rawName] =&gt; `voteDown`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; mediumint(8) unsigned
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 0
                                      [size] =&gt; 8
                                      [precision] =&gt; 8
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [reports] =&gt; CMysqlColumnSchema Object
                                  (
                                      [name] =&gt; reports
                                      [rawName] =&gt; `reports`
                                      [allowNull] =&gt; 
                                      [dbType] =&gt; smallint(5) unsigned
                                      [type] =&gt; integer
                                      [defaultValue] =&gt; 0
                                      [size] =&gt; 5
                                      [precision] =&gt; 5
                                      [scale] =&gt; 
                                      [isPrimaryKey] =&gt; 
                                      [isForeignKey] =&gt; 
                                      [autoIncrement] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                          )
  
                      [relations] =&gt; Array
                          (
                              [user] =&gt; CBelongsToRelation Object
                                  (
                                      [joinType] =&gt; LEFT OUTER JOIN
                                      [on] =&gt; 
                                      [alias] =&gt; 
                                      [with] =&gt; Array
                                          (
                                          )
  
                                      [together] =&gt; 
                                      [scopes] =&gt; 
                                      [name] =&gt; user
                                      [className] =&gt; User
                                      [foreignKey] =&gt; userId
                                      [select] =&gt; *
                                      [condition] =&gt; 
                                      [params] =&gt; Array
                                          (
                                          )
  
                                      [group] =&gt; 
                                      [join] =&gt; 
                                      [having] =&gt; 
                                      [order] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                              [post] =&gt; CBelongsToRelation Object
                                  (
                                      [joinType] =&gt; LEFT OUTER JOIN
                                      [on] =&gt; 
                                      [alias] =&gt; 
                                      [with] =&gt; Array
                                          (
                                          )
  
                                      [together] =&gt; 
                                      [scopes] =&gt; 
                                      [name] =&gt; post
                                      [className] =&gt; Posts
                                      [foreignKey] =&gt; postId
                                      [select] =&gt; *
                                      [condition] =&gt; 
                                      [params] =&gt; Array
                                          (
                                          )
  
                                      [group] =&gt; 
                                      [join] =&gt; 
                                      [having] =&gt; 
                                      [order] =&gt; 
                                      [_e:CComponent:private] =&gt; 
                                      [_m:CComponent:private] =&gt; 
                                  )
  
                          )
  
                      [attributeDefaults] =&gt; Array
                          (
                              [voteUp] =&gt; 0
                              [voteDown] =&gt; 0
                              [reports] =&gt; 0
                          )
  
                      [_model:CActiveRecordMetaData:private] =&gt; Comments Object
   *RECURSION*
                  )
  
              [_new:CActiveRecord:private] =&gt; 
              [_attributes:CActiveRecord:private] =&gt; Array
                  (
                  )
  
              [_related:CActiveRecord:private] =&gt; Array
                  (
                  )
  
              [_c:CActiveRecord:private] =&gt; 
              [_pk:CActiveRecord:private] =&gt; 
              [_alias:CActiveRecord:private] =&gt; t
              [_errors:CModel:private] =&gt; Array
                  (
                  )
  
              [_validators:CModel:private] =&gt; 
              [_scenario:CModel:private] =&gt; 
              [_e:CComponent:private] =&gt; 
              [_m:CComponent:private] =&gt; 
          )
  
      [keyAttribute] =&gt; 
      [_criteria:CActiveDataProvider:private] =&gt; CDbCriteria Object
          (
              [select] =&gt; *
              [distinct] =&gt; 
              [condition] =&gt; postId = 2
              [params] =&gt; Array
                  (
                  )
  
              [limit] =&gt; -1
              [offset] =&gt; -1
              [order] =&gt; commentTime desc
              [group] =&gt; 
              [join] =&gt; 
              [having] =&gt; 
              [with] =&gt; Array
                  (
                      [0] =&gt; user
                  )
  
              [alias] =&gt; 
              [together] =&gt; 
              [index] =&gt; 
              [scopes] =&gt; 
              [_e:CComponent:private] =&gt; 
              [_m:CComponent:private] =&gt; 
          )
  
      [_id:CDataProvider:private] =&gt; Comments
      [_data:CDataProvider:private] =&gt; 
      [_keys:CDataProvider:private] =&gt; 
      [_totalItemCount:CDataProvider:private] =&gt; 
      [_sort:CDataProvider:private] =&gt; 
      [_pagination:CDataProvider:private] =&gt; 
      [_e:CComponent:private] =&gt; 
      [_m:CComponent:private] =&gt; 
  )
  </code></pre>