Skip to content

Commit

Permalink
fix copy-paste fail found by @marius
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Apr 9, 2010
1 parent ccacb2d commit 3155cb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/mysql2_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ static VALUE rb_mysql_result_fetch_row(int argc, VALUE * argv, VALUE self) {
val = rb_float_new(strtod(row[i], NULL));
break;
case MYSQL_TYPE_TIME: // TIME field
if (memcmp("00:00:00", row[i], 10) == 0) {
val = rb_str_new(row[i], fieldLengths[i]);
if (memcmp("00:00:00", row[i], 8) == 0) {
val = Qnil;
} else {
strptime(row[i], "%T", &parsedTime);
val = rb_funcall(rb_cTime, intern_local, 6, INT2NUM(1900+parsedTime.tm_year), INT2NUM(parsedTime.tm_mon+1), INT2NUM(parsedTime.tm_mday), INT2NUM(parsedTime.tm_hour), INT2NUM(parsedTime.tm_min), INT2NUM(parsedTime.tm_sec));
Expand Down

0 comments on commit 3155cb7

Please sign in to comment.