DBZ-1773 Change test for null value
This commit is contained in:
parent
a4d3c1e89a
commit
f0cc055833
@ -163,7 +163,10 @@ else if (actualColumn.jdbcType() == Types.TIMESTAMP) {
|
||||
// JDBC's rs.GetObject() will return a Boolean for all TINYINT(1) columns.
|
||||
// TINYINT columns are reprtoed as SMALLINT by JDBC driver
|
||||
else if (actualColumn.jdbcType() == Types.TINYINT || actualColumn.jdbcType() == Types.SMALLINT) {
|
||||
return rs.wasNull() ? null : rs.getInt(fieldNo);
|
||||
// It seems that rs.wasNull() returns false when default value is set and NULL is inserted
|
||||
// We thus need to use getObject() to identify if the value was provided and if yes then
|
||||
// read it again to get correct scale
|
||||
return rs.getObject(fieldNo) == null ? null : rs.getInt(fieldNo);
|
||||
}
|
||||
else {
|
||||
return rs.getObject(fieldNo);
|
||||
|
@ -89,6 +89,6 @@ private void assertChangeRecord() throws InterruptedException {
|
||||
|
||||
Assertions.assertThat(change.getInt16("ti")).isEqualTo((short) 100);
|
||||
Assertions.assertThat(change.getInt16("ti1")).isEqualTo((short) 5);
|
||||
Assertions.assertThat(change.getInt16("ti2")).isEqualTo((byte) 50);
|
||||
Assertions.assertThat(change.getInt16("ti2")).isEqualTo((short) 50);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user