From e23d3e8087b449d36afe120747ed67a6356b6252 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 16 Mar 2020 11:36:08 +0100 Subject: [PATCH] [jOOQ/jOOQ#9958] Don't set precision / scale if not available --- jOOQ/src/main/java/org/jooq/impl/MetaImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java b/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java index aecad911b6..ca7e2cd421 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java @@ -854,8 +854,13 @@ final class MetaImpl extends AbstractMeta { type = DefaultDataType.getDataType(family(), typeName, precision, scale); // JDBC doesn't distinguish between precision and length - type = type.precision(precision, scale); - type = type.length(precision); + if (type.hasPrecision() && type.hasScale()) + type = type.precision(precision, scale); + else if (type.hasPrecision()) + type = type.precision(precision); + else if (type.hasLength()) + type = type.length(precision); + type = type.identity(isAutoIncrement); if (nullable == DatabaseMetaData.columnNoNulls)