[jOOQ/jOOQ#18965] Bad DDL generated when attempting to CREATE TABLE with

UUID column in Oracle and other dialects
This commit is contained in:
Lukas Eder 2025-09-01 10:45:57 +02:00
parent f336955121
commit 233fa3e981

View File

@ -6166,8 +6166,14 @@ final class Tools {
}
}
String typeName = type.getTypeName(ctx.configuration());
// [#5807] These databases cannot use the DataType.getCastTypeName() (which is simply char in this case)
if (type.getFromType() == UUID.class && NO_SUPPORT_CAST_TYPE_IN_DDL.contains(ctx.dialect())) {
// [#18965] Or, they require a length, but UUID.hasLength() is false
if (type.getFromType() == UUID.class && (
NO_SUPPORT_CAST_TYPE_IN_DDL.contains(ctx.dialect())
|| typeName.startsWith("varchar")
)) {
toSQLDDLTypeDeclaration(ctx, VARCHAR(36));
return;
}
@ -6182,7 +6188,6 @@ final class Tools {
}
DataType<?> elementType = type.getArrayBaseDataType();
String typeName = type.getTypeName(ctx.configuration());