Skip to content
Permalink
Browse files

Fixed #0003076.

  • Loading branch information...
gwilmer committed Apr 26, 2017
1 parent 0189008 commit 36f3b7c5db6cadd9f38dcc390bc2a276e795c654
Showing with 9 additions and 5 deletions.
  1. +9 −5 symmetric-jdbc/src/main/java/org/jumpmind/db/platform/mysql/MySqlDdlReader.java
@@ -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) {

0 comments on commit 36f3b7c

Please sign in to comment.
You can’t perform that action at this time.