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
-
Dan Sully June 19th, 2008 @ 10:31 AM
- no changes were found...
-
Dan Sully July 14th, 2008 @ 04:23 PM
- → Tag changed from to bug dataobjects do_mysql fix mysql patch
Ping?
-
Bernerd Schaefer July 22nd, 2008 @ 03:07 PM
- → State changed from new to resolved
As of 3580abb, I've updated do_mysql to return a nil value when a timestamp is set to a value of 0.
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 »
