From a0449b67a4cedf5a61b8d93a214b69b0e3896799 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 29 Jan 2021 14:07:22 +0100 Subject: [PATCH] [jOOQ/jOOQ#11334] Field.getDataType(Configuration) resets nullability --- jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java index 1c91a1fc21..09f7d44aa1 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java @@ -461,7 +461,7 @@ public class DefaultDataType extends AbstractDataTypeX { // If this is a SQLDataType find the most suited dialect-specific // data type if (getDialect() == null) { - DefaultDataType dataType = TYPES_BY_SQL_DATATYPE[configuration.family().ordinal()] + DefaultDataType dataType = (DefaultDataType) TYPES_BY_SQL_DATATYPE[configuration.family().ordinal()] // Be sure to reset length, precision, and scale, as those // values were not registered in the below cache @@ -471,7 +471,7 @@ public class DefaultDataType extends AbstractDataTypeX { // ... and then, set them back to the original value // [#2710] TODO: Remove this logic along with cached data types - return (DataType) dataType.length0(length).precision0(precision, scale); + return dataType.construct(precision, scale, length, nullability, collation, characterSet, identity, defaultValue); } // If this is already the dialect's specific data type, return this