Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed #0003076.
  • Loading branch information
gwilmer committed Apr 26, 2017
1 parent 0189008 commit 36f3b7c
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -101,16 +101,20 @@ 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.endsWith("_bin");

String convertTextToLobParm = System.getProperty("mysqlddlreader.converttexttolob",
"true");
boolean convertTextToLob = collation != null && collation.endsWith("_bin") &&
convertTextToLobParm.equalsIgnoreCase("true");

if ("LONGTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.CLOB;
return convertTextToLob ? Types.BLOB : Types.CLOB;
} else if ("MEDIUMTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
return convertTextToLob ? Types.BLOB : Types.LONGVARCHAR;
} else if ("TEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
return convertTextToLob ? Types.BLOB : Types.LONGVARCHAR;
} else if ("TINYTEXT".equals(typeName)) {
return isBinary ? Types.BLOB : Types.LONGVARCHAR;
return convertTextToLob ? Types.BLOB : Types.LONGVARCHAR;
}
return super.mapUnknownJdbcTypeForColumn(values);
} else if (type != null && type == Types.OTHER) {
Expand Down

0 comments on commit 36f3b7c

Please sign in to comment.