Too long column alias - Column.GetAlias() doesn't correctly respect Dialect.MaxAliasLength
Description
Column.GetAlias() currently takes Dialect.MaxAliasLength into account, but not correctly. In some cases it can generate too long aliases.
Problems: If the column name contains a non-letter, the name will be cut before that character. The code might then NOT fail the test for maximum length, but STILL apply the suffix, which can potentially generate a too long alias.
Secondly, when the GetAlias(dialiect, table) overloaded method is used, the length of the table suffix isn't accounted for.
This problably hasn't been noticed before because the base Dialect sets the MaxAliasLength to just 10 characters, and the only overriding dialects are some of the Sybase dialects. 10 characters is very short and probably the real maximum length is considerably longer in most RDBMS.
Column.GetAlias() currently takes Dialect.MaxAliasLength into account, but not correctly. In some cases it can generate too long aliases.
Problems:
If the column name contains a non-letter, the name will be cut before that character. The code might then NOT fail the test for maximum length, but STILL apply the suffix, which can potentially generate a too long alias.
Secondly, when the GetAlias(dialiect, table) overloaded method is used, the length of the table suffix isn't accounted for.
This problably hasn't been noticed before because the base Dialect sets the MaxAliasLength to just 10 characters, and the only overriding dialects are some of the Sybase dialects. 10 characters is very short and probably the real maximum length is considerably longer in most RDBMS.