MySQL Connector/NET Release Notes  /  Changes in MySQL Connector/Net 6.5  /  Changes in MySQL Connector/NET 6.5.5 (2012-12-03, General Availability)

Changes in MySQL Connector/NET 6.5.5 (2012-12-03, General Availability)

Fixes issues since the 6.5.4 release.

Functionality Added or Changed

  • The medium trust support using the MySQLClientPermissions class is now more flexible: in addition to the original deployment method, where the library is installed in the Global Assembly Cache (GAC), you can also install the library within a bin or lib folder inside the project or solution. When the library is deployed somewhere other than the GAC, the only protocol supported is TCP/IP. Existing applications that use the library installed in the GAC must now include an extra connection option, includesecurityasserts=true. For details, see Working with Partial Trust / Medium Trust. (Bug #14668820, Bug #65036)

Bugs Fixed

  • Performance: The LINQ to SQL data provider for MySQL was generating inefficient code for the Contains() method, producing a query with multiple OR clauses instead of the more efficient IN clause. (Bug #14016344, Bug #64934)

  • Performance: The LINQ to SQL data provider for MySQL was generating inefficient code for the StartsWith() and Contains() methods, calling the MySQL LOCATE() function rather than using a LIKE operator with a % wildcard. The fix causes both methods to use the LIKE syntax, although only StartsWith() gains a substantial performance improvement. Queries involving the StartsWith() method can now take advantage of an index on the corresponding column. (Bug #14009363, Bug #64935)

  • Calling the method FirstOrDefault LINQ to Entities queries caused a System.Data.EntityCommandCompilationException exception. (Bug #15856964, Bug #67377)

  • When using Entity Frameworks: Code First in Visual Studio 2012 and using a GUID as the primary key in a class, the following error could occur:

    Incorrect column specifier for column 'column_name'.

    Connector/NET was applying the AUTO_INCREMENT attribute to the column, which requires that the column use an integer data type. (Bug #15834176, Bug #67450)

  • Connection attempts using IPV6 addresses in Connector/NET would fail. (Bug #14835718, Bug #67253)

  • Visual Studio 2012 projects could sometimes give the following error dialog:

    Failed to merge object(s).
    Keyword not supported.
    Parameter name: AttachDbFilename.

    This issue affected mostly VisualStudio 2012 projects, either migrated from VisualStudio 2010 or including web sites created with VS2010, connecting to a MySQL 5.5 server. (Bug #14733472, Bug #66880)

  • When an application starts up, creates a connection, and then goes idle after a single database operation, the connections are now cleaned up more quickly: typically after an idle time of 3 minutes rather than 6 minutes. This optimization is especially useful for applications on low-traffic sites. (Bug #14652624, Bug #66472)

  • Under some circumstances, setting CacheServerProperties=true in the connection string could cause a Packet too large error. With connection pooling enabled and CacheServerProperties=true, the first connection worked as expected, but the second, third, and so on connections failed if the query exceeded 1024 bytes. (Bug #14593547, Bug #66578)

  • Connector/NET did not support creating an entity with a key of type string. During database creation, a MySqlException was thrown saying BLOB/TEXT column 'Name' used in key specification without a key length. The DDL produced by the provider specified a MEDIUMTEXT column for the primary key without specifying a length for the key. This fix is particularly important when working with Entity Framework versions 4.3 and later, since the __MigrationsHitory table (which replaces the EdmMetadata table) uses a string property as its key. (Bug #14540202, Bug #65289, Bug #64288)

  • The ExecuteNonQuery() could return an error Parameter '?' must be defined, when attempting to execute a statement such as:

    insert into table_name (Field1, Field1) VALUES(?,?)

    That is, when referencing the same field twice with two different ? placeholders. (Bug #14499549, Bug #66060)

  • When using a MySQL database set up as UTF32 as an membership database, web applications could give a key too long error, and the Website Administration Tool would not connect to providers. The cause was that the column my_aspnet_sessions.SessionId, when converted from Latin1 character set to UTF32 with 4 bytes per character, exceeded the length limit for a primary key:

    Specified key was too long; max key length is 767 bytes

    (Bug #14495292, Bug #65144)

  • The MySQL Connector/NET EntityFramework provider would throw NullReferenceException when trying to insert a new record with an empty VALUES clause. Such an INSERT should work when the only required (NOT NULL) column in the table is a primary key auto-increment column. (Bug #14479715, Bug #66066)

  • Using the Entity Data Model Designer decimal type and CreateDatabase function, the values were stored with 0 digits at the right of the decimal point. With this fix, the default is 2 digits to the right of the decimal point, and any precision specified through the Entity Data Model Designer is applied correctly. (Bug #14474342, Bug #65127)

  • Customizing precision by calling the HasPrecision() method within the OnModelCreating() method in a Code First project would always produce precision settings (10,2) rather than the specified precision. (Bug #14469048, Bug #65001)

  • When building commands through the MySql.Data.MySqlClient.MySqlCommand() class, memory could be leaked because some IO.MemoryStream instances were not being freed efficiently. The memory leak could be an issue in SQL-heavy applications, for example a logging application processing large numbers of INSERT statements. (Bug #14468204, Bug #65696)

  • When using the web security functionality with a MySQL database, using features that access the my_aspnet_usersinroles table caused an exception:

    MySql.Data.MySqlClient.MySqlException: Table 'testdb.my_aspnet_usersinrole' doesn't exist.

    For example, this error could occur when trying to remove the user from a role or find users in a role. The fix corrects the spelling of the table name to my_aspnet_usersinroles. (Bug #14405338, Bug #65805)

  • Although the member variable MySqlCommand.LastInsertedId was a 64-bit long, its value was effectively capped at the maximum value of Int32 (2,147,483,647). If a primary key exceeded this value, the value of LastInsertedId was wrong. This mismatch could be an issue for tables with large numbers of rows. (Bug #14171960, Bug #65452)

  • When using Entity Framework with Connector/NET, the association property OnDelete was not taken into account in the CreateDatabaseScript function of the ObjectContext, leading to an error message System.Data.UpdateException was unhandled. The SQL generated by the CreateDatabaseScript function was missing ON DELETE and ON UPDATE clauses. These clauses were filled in correctly by the DDL generation wizard. (Bug #14008752, Bug #64779)

  • A call to a stored procedure or function in an application using the Code First entity framework could result in an error:

    Unhandled Exception: MySql.Data.MySqlClient.MySqlException: You have an error
    in your SQL syntax; ...

    The code change allows syntax such as the following to invoke a stored procedure, without using the CALL statement and without using CommandType.StoredProcedure.

    int count = myContext.Database.SqlQuery<int>("GetCount").First();

    (Bug #14008699, Bug #64999)

  • When the length of a VARCHAR column was edited in Table Designer, the data type could be saved incorrectly as BIT. (Bug #13916560)

  • Any sequence of Take(n) method calls followed by Count or LongCount would cause a System.Data.EntityCommandCompilationException error. (Bug #13913047, Bug #64749)

  • When using the Entity Framework Code First approach, the generated code could be incorrect:

    • Missing length specifier for data types, such as VARBINARY instead of VARBINARY(n).

    • ALTER TABLE statements referring to nonexistent tables, when private members were specified inside the main class.

    (Bug #13900091, Bug #64216)

  • The milliseconds portion of a date/time value was not stored correctly for the datatype DATETIME(3). (Bug #13881444, Bug #64686)

  • When using the MySqlProfileProvider, calling the function ProfileManager.DeleteProfiles could throw an InvalidCastException exception. (Bug #13790123, Bug #64470)

  • A timing issue with the GetItemExclusive, SetAndReleaseItemExclusive, and GetItem functions could cause an application to freeze for almost 2 minutes if GetItem was called at a particular moment when a session was already locked as read-only. (Bug #13733054, Bug #63997)

  • In Visual Studio Table Designer, the name of a new index was always derived from the name of the table and could not be changed. (Bug #13613801)

  • When using the Entity Framework Code First approach, the generated code could be use the MEDIUMTEXT data type in contexts where other types such as VARCHAR were more appropriate, leading to errors such as:

    error 0064: Facet 'MaxLength' must not be specified for type 'mediumtext'.

    (Bug #13582335, Bug #63920)

  • In LINQ to Entity queries, including a child entity (1-n) and its entities (n-n) returned the wrong results. For example:


    (Bug #13491698, Bug #62801)

  • In Visual Studio 2005, adding a new data connection through the Server Explorer produced an error message: Package Load Failure. The Visual Studio plugin was dynamically linked against VS2008 version of assembly Microsoft.VisualStudio.Data (v9.0). The fixed plugin links with the VS2005 version (v8.0) of that library instead, which is upward compatible with later Visual Studio versions. (Bug #13491674, Bug #63073)

  • Formerly, cleanup operations for expired sessions were fully automatic, with no ability to catch the timeout event and do application-specific cleanup. This fix adds a enableSessionExpireCallback connection option to let developers catch the event when a session expires. When enableSessionExpireCallback is enabled, the global.asax.session_end event is raised before data is deleted from the my_aspnet_sessions table. When enableSessionExpireCallback is disabled, the data is deleted from the my_aspnet_sessions table without raising the event first. The timeout period for session expiry is specified in the web.config file, in the timeout option of the sessionState section. (Bug #13354935, Bug #62266)