Skip to content

Commit

Permalink
Fixed `Incorrect datetime value: '1969-12-31 23:59:59.999' for column…
Browse files Browse the repository at this point in the history
… '_from' ` #mam-78
  • Loading branch information
hantu85 authored and woj-tek committed Feb 27, 2023
1 parent b7630e1 commit ec849fb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ protected int setQueryParams(PreparedStatement stmt, Q crit, FasteningCollation
stmt.setObject(i++, null);
}
if (crit.getStart() != null) {
if (data_repo.getDatabaseType() == DataRepository.dbTypes.mysql && crit.getStart().getTime() == 0) {
if (data_repo.getDatabaseType() == DataRepository.dbTypes.mysql && crit.getStart().getTime() <= 0) {
stmt.setObject(i++, null);
} else {
data_repo.setTimestamp(stmt, i++, convertToTimestamp(crit.getStart()));
Expand All @@ -411,7 +411,7 @@ protected int setQueryParams(PreparedStatement stmt, Q crit, FasteningCollation
stmt.setObject(i++, null);
}
if (crit.getEnd() != null) {
if (data_repo.getDatabaseType() == DataRepository.dbTypes.mysql && crit.getEnd().getTime() == 0) {
if (data_repo.getDatabaseType() == DataRepository.dbTypes.mysql && crit.getEnd().getTime() <= 0) {
stmt.setObject(i++, null);
} else {
data_repo.setTimestamp(stmt, i++, convertToTimestamp(crit.getEnd()));
Expand Down

0 comments on commit ec849fb

Please sign in to comment.