I got this code in Yii:
$comment = Comment::model()->with(array('issue'=> array( 'condition'=>'project_id = 1')))->findAll(array( 'order' => 't.create_time DESC', 'limit' => 2, ));
when I changed “‘limit’=>2” to “‘limit’ =>null”, then my web app run without any errors.
As I understand that if I changed those values the equivalent query will change to:
SELECT tbl_comment . * , tbl_issue . * FROM tbl_comment LEFT JOIN tbl_issue ON tbl_issue.id = tbl_comment.issue_id WHERE tbl_issue.project_id = 1 LIMIT null
I have tried this sql on mysql command line and the above query didn’t pass on mysql, but it did pass when I use the CODE above in Yii.
So, could you tell me why did this conflic occur? Thank you.