HHH-16094 HHH-17097 MySQL schema generation and validation : tinytext instead of longtext for @Lob

This commit is contained in:
Andrea Boriero 2024-04-23 09:15:18 +02:00 committed by Christian Beikov
parent 58b5cea899
commit 8f9d1a15ad
1 changed files with 11 additions and 2 deletions

View File

@ -152,6 +152,16 @@ public class MySQLDialect extends Dialect {
//we set scale > 20 //we set scale > 20
size.setScale( Math.min( size.getPrecision(), 20 ) ); size.setScale( Math.min( size.getPrecision(), 20 ) );
return size; return size;
case BLOB:
case NCLOB:
case CLOB:
return super.resolveSize(
jdbcType,
javaType,
precision,
scale,
length == null ? getDefaultLobLength() : length
);
default: default:
return super.resolveSize( jdbcType, javaType, precision, scale, length ); return super.resolveSize( jdbcType, javaType, precision, scale, length );
} }
@ -524,8 +534,7 @@ public class MySQLDialect extends Dialect {
@Override @Override
public long getDefaultLobLength() { public long getDefaultLobLength() {
//max length for mediumblob or mediumtext return Integer.MAX_VALUE;
return 16_777_215;
} }
@Override @Override