#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:


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 Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

People watching this ticket