{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii/issues/2993","labels_url":"https://api.github.com/repos/yiisoft/yii/issues/2993/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii/issues/2993/comments","events_url":"https://api.github.com/repos/yiisoft/yii/issues/2993/events","html_url":"https://github.com/yiisoft/yii/issues/2993","id":21620219,"number":2993,"title":"Crash when inserting a record with a DATETIME with CURRENT_TIMESTAMP as default","user":{"login":"jcherniak","id":1727656,"avatar_url":"https://avatars.githubusercontent.com/u/1727656?v=3","gravatar_id":"","url":"https://api.github.com/users/jcherniak","html_url":"https://github.com/jcherniak","followers_url":"https://api.github.com/users/jcherniak/followers","following_url":"https://api.github.com/users/jcherniak/following{/other_user}","gists_url":"https://api.github.com/users/jcherniak/gists{/gist_id}","starred_url":"https://api.github.com/users/jcherniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcherniak/subscriptions","organizations_url":"https://api.github.com/users/jcherniak/orgs","repos_url":"https://api.github.com/users/jcherniak/repos","events_url":"https://api.github.com/users/jcherniak/events{/privacy}","received_events_url":"https://api.github.com/users/jcherniak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2013-10-25T22:29:18Z","updated_at":"2015-10-18T09:41:08Z","closed_at":null,"body":"MySQL 5.6 supports having DATETIME columns with TIMESTAMP semantics.  Among other things, they support having DATETIME columns with CURRENT_TIMESTAMP default values.\r\n\r\nIf you try and save a CActiveRecord which has one of these columns, you see the following error:\r\n    CDbException - CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'last_updated' at row 1.\r\n\r\nIt seems that the framework is interpreting the CURRENT_TIMESTAMP value as a string instead of a CDbExpression"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii/issues/comments/148995411","html_url":"https://github.com/yiisoft/yii/issues/2993#issuecomment-148995411","issue_url":"https://api.github.com/repos/yiisoft/yii/issues/2993","id":148995411,"user":{"login":"tomvdp","id":977799,"avatar_url":"https://avatars.githubusercontent.com/u/977799?v=3","gravatar_id":"","url":"https://api.github.com/users/tomvdp","html_url":"https://github.com/tomvdp","followers_url":"https://api.github.com/users/tomvdp/followers","following_url":"https://api.github.com/users/tomvdp/following{/other_user}","gists_url":"https://api.github.com/users/tomvdp/gists{/gist_id}","starred_url":"https://api.github.com/users/tomvdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomvdp/subscriptions","organizations_url":"https://api.github.com/users/tomvdp/orgs","repos_url":"https://api.github.com/users/tomvdp/repos","events_url":"https://api.github.com/users/tomvdp/events{/privacy}","received_events_url":"https://api.github.com/users/tomvdp/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T09:41:08Z","updated_at":"2015-10-18T09:41:08Z","body":"FWIW, I just hit exactly this bug.\r\nI need a datetime with default CURRENT_TIMESTAMP.\r\nWhy does Yii try to supply values when the database has already defined its own defaults ?\r\n\r\n(still working in Yii 1.1 - might be resolved in Yii2?)"}}