[CONJ-100] the feature "Return null for 'zero' timestamps" while return a wrong result when call ResultSet.wasNull(). Created: 2014-05-13 Updated: 2014-11-26 Resolved: 2014-11-26 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Han Yinghan | Assignee: | Massimo Siani (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
when we select a record from a table and the value of timestamp field is '0000-00-00 00:00:00', the result of this field is null, that's OK. but when we call wasNull(), is return false. |
||
| Description |
|
test code : else { return new java.util.Date(sqlTimestamp.getTime()); }} when the value of the field 'columnName' is '0000-00-00 00:00:00', rs.wasNull() will return false, not true. it is wrong. |
| Comments |
| Comment by Han Yinghan [ 2014-05-13 ] |
|
we solved this problem with following code: AbstractValueObject.java public boolean isNull() { return rawBytes == null || (dataType == MySQLType.TIMESTAMP && "0000-00-00 00:00:00".equals(getString()) ) ; } |