We're updating the issue view to help you get more done. 

Dialect.GetCastTypeName is buggy

Description

Dialect.GetCastTypeName takes a SqlType, disregards the type Length/Precision/Scale and use instead Column.DefaultLength/Column.DefaultPrecision/Column.DefaultScale, which are 255/19/2.

A default scale of 2 is quite debatable for decimal, but it does not get used in fact due to a bug: the type resolution currently compares provided length with the max for the type, which is well below 255 for decimal, so it always uses the default for decimal type, like decimal(19,5) with SqlServer2000Dialect.

Moreover, is such a hard-coded string limitation to a 255 length really sound in a modern library?

Environment

None

Status

Assignee

Frédéric Delaporte

Reporter

Frédéric Delaporte

Components

Fix versions

Affects versions

4.1.1

Priority

Minor