Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.1.2
-
None
Description
We updated mariadb-java client from version 2.72 to 3.1.2
This seems to cause an jdbc compatibility problem as follows.
There is a Timestamp 0,0,0 0,0,0:000 in the database. mariadb-java reads this value and converts this to null.
See https://github.com/mariadb-corporation/mariadb-connector-j/blame/master/src/main/java/org/mariadb/jdbc/client/column/TimestampColumn.java
// xpand workaround https://jira.mariadb.org/browse/XPT-274
|
if (year == 0
|
&& month == 0
|
&& dayOfMonth == 0
|
&& hour == 0
|
&& minutes == 0
|
&& seconds == 0
|
&& microseconds == 0) return null;
|
I dont know what the comment means, and the link doesnt work for me. However this behavior means that ResultSet#getTimestamp will return null, if the databse value is not NULL but 0,0,0 0,0,0:000.
our codebase asumes that ResultSet#getTimespamp can only return null, if the Coloumn Value is SQL NULL (as checked with #wasNull). However in this case #wasNull will return false, yet the value will be null, causing a Nullpointer Exception in the process.
I guess thats a jdbc compatibility violation?