@@ -25,7 +25,7 @@ class ColumnDefinitions {
25
25
26
26
static boolean hasMatchingType (Column column , ColumnInformation columnInformation , Metadata metadata , Dialect dialect ) {
27
27
boolean typesMatch = dialect .equivalentTypes ( column .getSqlTypeCode (metadata ), columnInformation .getTypeCode () )
28
- || stripArgs ( column .getSqlType ( metadata ) ). equalsIgnoreCase ( columnInformation .getTypeName () );
28
+ || hasSameColumnType ( stripArgs ( column .getSqlType ( metadata ) ), columnInformation .getTypeName () );
29
29
if ( typesMatch ) {
30
30
return true ;
31
31
}
@@ -43,6 +43,21 @@ static boolean hasMatchingType(Column column, ColumnInformation columnInformatio
43
43
}
44
44
}
45
45
46
+ private static boolean hasSameColumnType (String metadataColumnTypeString , String columnInformationColumnTypeString ) {
47
+ /*
48
+ tokenize the metadata column type string, since that could include more than just the type information, such as e.g. 'unsigned',
49
+ and we can't just check if it contains the other one, since that would fail with e.g. tinyint and int
50
+ the column information type string, as per InformationExtractorJdbcDatabaseMetaDataImpl.addColumns (L160) should already
51
+ only contain a single string
52
+ */
53
+ for (String s : metadataColumnTypeString .split ( " " ) ) {
54
+ if ( s .equalsIgnoreCase ( columnInformationColumnTypeString ) ) {
55
+ return true ;
56
+ }
57
+ }
58
+ return false ;
59
+ }
60
+
46
61
static boolean hasMatchingLength (Column column , ColumnInformation columnInformation , Metadata metadata , Dialect dialect ) {
47
62
final int actualSize = columnInformation .getColumnSize ();
48
63
if ( actualSize == 0 ) {
0 commit comments