Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-2809

Incorrect specification of VARBINARY(MAX) in MsSql2005Dialect

    Details

    • Sprint:

      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)"); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ranco.marcus Ranco Marcus
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Who's Looking?