#396 √ resolved
Dan Sully

mysql adaptor fails when timestamp column is default 0

Reported by Dan Sully | June 17th, 2008 @ 05:39 PM

A MySQL schema can have a timestamp with a default value of 0:

ts TIMESTAMP DEFAULT 0,

parse_time() in do_mysql.c calls Time.local("0000-00-00 00:00:00"), which fails.

A possible fix is above the Time.local() call:

if (year+month+day+hour+min+sec+usec == 0) {

return rb_funcall(rb_cTime, rb_intern("local"), 1, INT2NUM(0));

}

Which will return a correct value instead of throwing an argument error.

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket