{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9006","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9006/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9006/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9006/events","html_url":"https://github.com/yiisoft/yii2/issues/9006","id":93109485,"number":9006,"title":"MySQL BIT column always returned as true","user":{"login":"stratoss","id":8927314,"avatar_url":"https://avatars.githubusercontent.com/u/8927314?v=3","gravatar_id":"","url":"https://api.github.com/users/stratoss","html_url":"https://github.com/stratoss","followers_url":"https://api.github.com/users/stratoss/followers","following_url":"https://api.github.com/users/stratoss/following{/other_user}","gists_url":"https://api.github.com/users/stratoss/gists{/gist_id}","starred_url":"https://api.github.com/users/stratoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratoss/subscriptions","organizations_url":"https://api.github.com/users/stratoss/orgs","repos_url":"https://api.github.com/users/stratoss/repos","events_url":"https://api.github.com/users/stratoss/events{/privacy}","received_events_url":"https://api.github.com/users/stratoss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/feature:db","name":"feature:db","color":"bfd4f2"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:to%20be%20verified","name":"status:to be verified","color":"fbca04"}],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/9","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/9/labels","id":831720,"number":9,"title":"2.0.x","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":396,"closed_issues":2,"state":"open","created_at":"2014-10-19T13:49:45Z","updated_at":"2015-07-29T16:02:36Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2015-07-05T12:54:41Z","updated_at":"2015-07-29T17:22:33Z","closed_at":null,"body":"Table structure:\r\n```sql\r\n--\r\n-- Table structure for table `demo`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `demo` (\r\n`id` bigint(20) unsigned NOT NULL,\r\n  `test` bit(1) NOT NULL\r\n) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;\r\n\r\n--\r\n-- Dumping data for table `demo`\r\n--\r\n\r\nINSERT INTO `demo` (`id`, `test`) VALUES\r\n(1, b'0'),\r\n(2, b'1');\r\n```\r\n\r\nTest code using auto-generated model:\r\n```php\r\n$all = Demo::find()->all();\r\nforeach ($all as $current) {\r\n    var_dump($current->test);\r\n}\r\n```\r\nResults are TRUE 2 times.\r\n\r\nFetching as array:\r\n```php\r\n$all = Demo::find()->asArray()->all();\r\nforeach($all as $current) {\r\n    if ($current['test'] === chr(0x00))\r\n        echo 0 . PHP_EOL;\r\n    elseif ($current['test'] === chr(0x01))\r\n        echo 1 . PHP_EOL;\r\n}\r\n```\r\nreturns 0 and 1."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/126025515","html_url":"https://github.com/yiisoft/yii2/issues/9006#issuecomment-126025515","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9006","id":126025515,"user":{"login":"stratoss","id":8927314,"avatar_url":"https://avatars.githubusercontent.com/u/8927314?v=3","gravatar_id":"","url":"https://api.github.com/users/stratoss","html_url":"https://github.com/stratoss","followers_url":"https://api.github.com/users/stratoss/followers","following_url":"https://api.github.com/users/stratoss/following{/other_user}","gists_url":"https://api.github.com/users/stratoss/gists{/gist_id}","starred_url":"https://api.github.com/users/stratoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratoss/subscriptions","organizations_url":"https://api.github.com/users/stratoss/orgs","repos_url":"https://api.github.com/users/stratoss/repos","events_url":"https://api.github.com/users/stratoss/events{/privacy}","received_events_url":"https://api.github.com/users/stratoss/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T17:22:33Z","updated_at":"2015-07-29T17:22:33Z","body":"@RusAlex No, I didn't, because I'm currently using the latest versions my distro provides. The fact is that at least for everyone using those versions (which is everyone using Debian OS) - the bug exists."}}