Fix longvarbinary (#3119)
* Handle LONGVARBINARY * Add implementation and changelog * Add type
This commit is contained in:
parent
5f672bc9e8
commit
8a1e8f4b2f
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 3118
|
||||||
|
jira: SMILE-3254
|
||||||
|
title: "MySQL 5.7 maps BLOB columns to LONGVARBINARY and the migrator did not take this into account. This has been fixed."
|
|
@ -189,10 +189,18 @@ public class JdbcUtils {
|
||||||
return new ColumnType(ColumnTypeEnum.DATE_TIMESTAMP, length);
|
return new ColumnType(ColumnTypeEnum.DATE_TIMESTAMP, length);
|
||||||
case Types.BLOB:
|
case Types.BLOB:
|
||||||
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
||||||
|
case Types.LONGVARBINARY:
|
||||||
|
if (DriverTypeEnum.MYSQL_5_7.equals(theConnectionProperties.getDriverType())) {
|
||||||
|
//See git
|
||||||
|
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Don't know how to handle datatype " + dataType + " for column " + theColumnName + " on table " + theTableName);
|
||||||
|
}
|
||||||
case Types.VARBINARY:
|
case Types.VARBINARY:
|
||||||
if (DriverTypeEnum.MSSQL_2012.equals(theConnectionProperties.getDriverType())) {
|
if (DriverTypeEnum.MSSQL_2012.equals(theConnectionProperties.getDriverType())) {
|
||||||
// MS SQLServer seems to be mapping BLOB to VARBINARY under the covers, so we need to reverse that mapping
|
// MS SQLServer seems to be mapping BLOB to VARBINARY under the covers, so we need to reverse that mapping
|
||||||
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Don't know how to handle datatype " + dataType + " for column " + theColumnName + " on table " + theTableName);
|
throw new IllegalArgumentException("Don't know how to handle datatype " + dataType + " for column " + theColumnName + " on table " + theTableName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue