Skip to content

Commit

Permalink
Removing check for "invalid dates"
Browse files Browse the repository at this point in the history
  • Loading branch information
iterion committed Nov 25, 2011
1 parent a1ddafa commit 110b769
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions ext/mysql2/result.c
Expand Up @@ -278,10 +278,6 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
if (seconds == 0) {
val = Qnil;
} else {
if (month < 1 || day < 1) {
rb_raise(cMysql2Error, "Invalid date: %s", row[i]);
val = Qnil;
} else {
if (seconds < MYSQL2_MIN_TIME || seconds > MYSQL2_MAX_TIME) { // use DateTime instead
VALUE offset = INT2NUM(0);
if (db_timezone == intern_local) {
Expand All @@ -306,7 +302,6 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
}
}
}
}
}
break;
}
Expand All @@ -317,12 +312,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
if (year+month+day == 0) {
val = Qnil;
} else {
if (month < 1 || day < 1) {
rb_raise(cMysql2Error, "Invalid date: %s", row[i]);
val = Qnil;
} else {
val = rb_funcall(cDate, intern_new, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
}
val = rb_funcall(cDate, intern_new, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
}
break;
}
Expand Down

0 comments on commit 110b769

Please sign in to comment.