Hi Bin Xiang,
This has been fixed in
http://bugs.mysql.com/bug.php?id=64216
The fix has not yet made it to any release of Connector/NET, will be available in 6.4.5 & 6.5.5.
The following is the code for the fix (at file /source/MySql.Data.Entity/ProviderManifest.cs, method
public override TypeUsage GetStoreType(TypeUsage edmType) ):
Locate this code:
if (isFixedLength)
{
if (maxLength < CHAR_MAXLEN) typeName = "tinyblob";
else if (maxLength < MEDIUMBLOB_MAXLEN) typeName = "blob";
else if (maxLength < LONGTEXT_MAXLEN) typeName = "mediumblob";
else typeName = "longblob";
}
else
{
typeName = isMaxLength || maxLength > BINARY_MAXLEN ? "varbinary" : "binary";
maxLength = isMaxLength ? VARBINARY_MAXLEN : maxLength;
}
And replace it with:
// now this applies for both isFixedLength and !isFixedLength
if (maxLength < CHAR_MAXLEN) typeName = "tinyblob";
else if (maxLength < MEDIUMBLOB_MAXLEN) typeName = "blob";
else if (maxLength < LONGTEXT_MAXLEN) typeName = "mediumblob";
else typeName = "longblob";
The fix uses now mysql's blob which is also fully compatible with 'varbinary' in MSSQL.
Let me know if that helps.
Thanks.