Incorrect specification of VARBINARY(MAX) in MsSql2005Dialect

Description

MsSql2005Dialect.RegisterCharacterTypeMappings contains a type registration for binary with length int.MaxValue. It correctly specifies it to be translated to varbinary(max) in SQL Server 2005 and 2008.

However, after RegisterCharacterTypeMappings, the constructor of MsSql2000Dialect calls RegisterLargeObjectTypeMappings in which the above type is overridden to use the 'image' data type.

Suggested fix (in MsSql2005Dialect):

Remove the line below from RegisterCharacterTypeMappings

RegisterColumnType(DbType.Binary, SqlClientDriver.MaxSizeForBlob, "VARBINARY(MAX)");

and add

protected override void RegisterLargeObjectTypeMappings()
{
base.RegisterLargeObjectTypeMappings();
RegisterColumnType(DbType.Binary, SqlClientDriver.MaxSizeForBlob, "VARBINARY(MAX)");
}

Environment

None

Activity

Oskar Berggren 
May 30, 2012 at 6:31 PM

Closing issues fixed in 3.3.1.CR1.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created July 26, 2011 at 3:52 PM
Updated May 30, 2012 at 6:31 PM
Resolved November 27, 2011 at 3:58 PM
Who's Looking?