# MySQL adapter bug? Date col being set to NULL when default i

**URL:** <https://www.ruby-forum.com/t/mysql-adapter-bug-date-col-being-set-to-null-when-default-i/103454>\
**Category:** Rails\
**Created:** [May 6, 2007, 10:35am UTC](https://www.ruby-forum.com/t/mysql-adapter-bug-date-col-being-set-to-null-when-default-i/103454 "2007-05-06T10:35:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rovnak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4bbf92/32.png) [@rovnak](https://www.ruby-forum.com/u/rovnak)\
**Post date:** [May 6, 2007, 10:35am UTC](https://www.ruby-forum.com/t/mysql-adapter-bug-date-col-being-set-to-null-when-default-i/103454/1 "2007-05-06T10:35:17Z")

</div>

Ok, simple case. MySQL table with date column. The date column default  
is 0000-00-00.

When I view these rows in say SQLyog, all rows in this table have  
value of 0000-00-00. by default.

…  
Now, onto my Rails app. I don’t even care about the date column  
described above. I am attempting to update an entirely different  
column in the same table.

However, when I use an active record to update the other column, my  
update fails because ActiveRecord is submitting “NULL” for the date  
column in question.

ActiveRecord::StatementInvalid (Mysql::Error: Column was set to data  
type implicit default; NULL supplied for NOT NULL column  
‘birthday\_search’ at row 1: UPDATE vb\_user SET `birthday_search` =  
NULL,

What is happening here? This seems like an obvious bug, no?
