Skip to content

Commit

Permalink
0002964: MEDIUMTEXT/LONGTEXT columns being converted to hex
Browse files Browse the repository at this point in the history
representation on mysql data on extract at source node
  • Loading branch information
maxwellpettit committed Apr 26, 2017
1 parent 3abc915 commit 0189008
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -101,12 +101,14 @@ protected Integer mapUnknownJdbcTypeForColumn(Map<String, Object> values) {
String collation = platform.getSqlTemplate().queryForString("select collation_name from information_schema.columns " +
"where table_schema = ? and table_name = ? and column_name = ?",
catalog, tableName, columnName);
boolean isBinary = collation != null && collation.equalsIgnoreCase("utf8_bin");
boolean isBinary = collation != null && collation.endsWith("_bin");

if ("LONGTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.CLOB;
} else if ("MEDIUMTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
} else if ("TEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
} else if ("TINYTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
}
Expand Down

0 comments on commit 0189008

Please sign in to comment.