From 1ae9313b651be20fa0abdd6a0366ceec6739e84d Mon Sep 17 00:00:00 2001 From: lukaseder Date: Thu, 24 May 2018 14:16:45 +0200 Subject: [PATCH] [#7504] [#7505] DefaultDataType.getDataType(SQLDialect) should use family - [#7504] DefaultDataType.getDataType(SQLDialect) should use family - [#7505] JDBCDatabase doesn't recognise vendor-specific data types --- jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java index 45e126faad..e96f8363bf 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java @@ -783,7 +783,8 @@ public class DefaultDataType implements DataType { } public static final DataType getDataType(SQLDialect dialect, String typeName) { - int ordinal = dialect.ordinal(); + SQLDialect family = dialect.family(); + int ordinal = family.ordinal(); String upper = typeName.toUpperCase(); String normalised = typeName; DataType result = TYPES_BY_NAME[ordinal].get(upper); @@ -797,11 +798,11 @@ public class DefaultDataType implements DataType { result = TYPES_BY_NAME[SQLDialect.DEFAULT.ordinal()].get(normalised); // [#4065] PostgreSQL reports array types as _typename, e.g. _varchar - if (result == null && dialect.family() == SQLDialect.POSTGRES && normalised.charAt(0) == '_') + if (result == null && family == SQLDialect.POSTGRES && normalised.charAt(0) == '_') result = getDataType(dialect, normalised.substring(1)).getArrayDataType(); // [#6466] HSQLDB reports array types as XYZARRAY - if (result == null && dialect.family() == SQLDialect.HSQLDB && upper.endsWith(" ARRAY")) + if (result == null && family == SQLDialect.HSQLDB && upper.endsWith(" ARRAY")) result = getDataType(dialect, typeName.substring(0, typeName.length() - 6)).getArrayDataType(); // [#366] Don't log a warning here. The warning is logged when