Fixes #1791.
Merge branch 'master' of github.com:yiisoft/yii2

Conflicts:
	framework/yii/db/ActiveQuery.php