|
org.hibernate.dialect.MySQLDialect#getCastTypeName:
switch ( code ) {
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
return "signed";
case Types.FLOAT:
case Types.NUMERIC:
case Types.REAL:
return "decimal";
case Types.VARCHAR:
return "char";
case Types.VARBINARY:
return "binary";
default:
return super.getCastTypeName( code );
The mappings to "decimal" are incorrect. The problem is that on MySQL and MariaDB DECIMAL (no precision/scale) is DECIMAL(10,0). So any value being cast that have digits to the right of the decimal point will have those digits dropped (12.399999999994 becomes 12).
We need to given precision/scale to the result here. The problem is what values to use for precision/scale?
|