Skip to content

Commit

Permalink
refactor by DBZ-3700
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanhang1993 committed Jun 15, 2022
1 parent 724676a commit 7f79cb9
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,22 @@ else if (actualColumn.jdbcType() == Types.TINYINT
// DBZ-2673
// It is necessary to check the type names as types like ENUM and SET are
// also reported as JDBC type char
else if ("CHAR".equals(actualColumn.typeName())
|| "VARCHAR".equals(actualColumn.typeName())
|| "TEXT".equals(actualColumn.typeName())) {
return rs.getString(fieldNo);
else if (connectorConfig
.customConverterRegistry()
.getValueConverter(actualTable.id(), actualColumn)
.isPresent()
&& ("CHAR".equals(actualColumn.typeName())
|| "VARCHAR".equals(actualColumn.typeName())
|| "TEXT".equals(actualColumn.typeName()))) {
try {
return rs.getString(fieldNo).getBytes(actualColumn.charsetName());
} catch (UnsupportedEncodingException e) {
LOG.warn(
"Unsupported encoding '{}' for column '{}', sending value as String",
actualColumn.charsetName(),
actualColumn.name());
return rs.getObject(fieldNo);
}
} else {
return rs.getObject(fieldNo);
}
Expand Down

0 comments on commit 7f79cb9

Please sign in to comment.