{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/12968","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/12968/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/12968/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/12968/events","html_url":"https://github.com/yiisoft/yii2/issues/12968","id":188634974,"number":12968,"title":"Activedataprovider set limit inside of query with union but should outside","user":{"login":"tunforjob","id":5564697,"avatar_url":"https://avatars.githubusercontent.com/u/5564697?v=3","gravatar_id":"","url":"https://api.github.com/users/tunforjob","html_url":"https://github.com/tunforjob","followers_url":"https://api.github.com/users/tunforjob/followers","following_url":"https://api.github.com/users/tunforjob/following{/other_user}","gists_url":"https://api.github.com/users/tunforjob/gists{/gist_id}","starred_url":"https://api.github.com/users/tunforjob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunforjob/subscriptions","organizations_url":"https://api.github.com/users/tunforjob/orgs","repos_url":"https://api.github.com/users/tunforjob/repos","events_url":"https://api.github.com/users/tunforjob/events{/privacy}","received_events_url":"https://api.github.com/users/tunforjob/received_events","type":"User","site_admin":false},"labels":[{"id":115010082,"url":"https://api.github.com/repos/yiisoft/yii2/labels/feature:db","name":"feature:db","color":"bfd4f2","default":false},{"id":33241821,"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/20","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.11","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/20/labels","id":1736699,"number":20,"title":"2.0.11","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":124,"closed_issues":55,"state":"open","created_at":"2016-04-28T15:04:50Z","updated_at":"2016-11-11T08:45:38Z","due_on":"2016-12-18T00:00:00Z","closed_at":null},"comments":3,"created_at":"2016-11-10T22:23:52Z","updated_at":"2016-11-11T08:57:25Z","closed_at":null,"body":"### What steps will reproduce the problem?\r\n```\r\n$query = Product::find()->where(['id' => 1]);\r\n$query2 = Product::find()->where(['id' => 2]);\r\n$query-> union($query2);\r\n$provider = new ActiveDataProvider([\r\n'query' => $query,\r\n    'pagination' => [\r\n        'pageSize' => 12,\r\n    ],\r\n]);\r\n$provider->getModels();\r\n```\r\n### What is the expected result?\r\n(SELECT * FROM `product` WHERE `id`=1) UNION ( SELECT * FROM `product` WHERE `id`=2 ) LIMIT 12\r\n### What do you get instead?\r\n(SELECT * FROM `product` WHERE `id`=1 LIMIT 12) UNION ( SELECT * FROM `product` WHERE `id`=2 )\r\n\r\n### Additional info\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.?\r\n| PHP version      |\r\n| Operating system |\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/259911487","html_url":"https://github.com/yiisoft/yii2/issues/12968#issuecomment-259911487","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/12968","id":259911487,"user":{"login":"dynasource","id":125726,"avatar_url":"https://avatars.githubusercontent.com/u/125726?v=3","gravatar_id":"","url":"https://api.github.com/users/dynasource","html_url":"https://github.com/dynasource","followers_url":"https://api.github.com/users/dynasource/followers","following_url":"https://api.github.com/users/dynasource/following{/other_user}","gists_url":"https://api.github.com/users/dynasource/gists{/gist_id}","starred_url":"https://api.github.com/users/dynasource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dynasource/subscriptions","organizations_url":"https://api.github.com/users/dynasource/orgs","repos_url":"https://api.github.com/users/dynasource/repos","events_url":"https://api.github.com/users/dynasource/events{/privacy}","received_events_url":"https://api.github.com/users/dynasource/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T08:57:25Z","updated_at":"2016-11-11T08:57:25Z","body":"> It's a specific use case.\r\n\r\nNot if you look at the topic @klimov-paul supplied. We should develop a solution that matches the expected result of the issue introduction."}}
{"actor":{"display_login":"dynasource"}}