Fixes issues since the 6.5.4 release.
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 abin
orlib
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, WL #2925)
Performance: The LINQ to SQL data provider for MySQL was generating inefficient code for the
Contains()
method, producing a query with multipleOR
clauses instead of the more efficientIN
clause. (Bug #14016344, Bug #64934)Performance: The LINQ to SQL data provider for MySQL was generating inefficient code for the
StartsWith()
andContains()
methods, calling the MySQLLOCATE()
function rather than using aLIKE
operator with a%
wildcard. The fix causes both methods to use theLIKE
syntax, although onlyStartsWith()
gains a substantial performance improvement. Queries involving theStartsWith()
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 aSystem.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 ASP.net applications on low-traffic sites. (Bug #14652624, Bug #66472)
Under some circumstances, setting
CacheServerProperties=true
in the connection string could cause aPacket too large
error. With connection pooling enabled andCacheServerProperties=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 sayingBLOB/TEXT column 'Name' used in key specification without a key length
. The DDL produced by the provider specified aMEDIUMTEXT
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 theEdmMetadata
table) uses a string property as its key. (Bug #14540202, Bug #65289, Bug #64288)-
The
ExecuteNonQuery()
could return an errorParameter '?' 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 ASP.net 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 columnmy_aspnet_sessions.SessionId
, when converted fromLatin1
character set toUTF32
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 emptyVALUES
clause. Such anINSERT
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 andCreateDatabase
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 theOnModelCreating()
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 someIO.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 ofINSERT
statements. (Bug #14468204, Bug #65696)-
When using the ASP.net 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-bitlong
, its value was effectively capped at the maximum value ofInt32
(2,147,483,647). If a primary key exceeded this value, the value ofLastInsertedId
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 theCreateDatabaseScript
function of theObjectContext
, leading to an error messageSystem.Data.UpdateException was unhandled
. The SQL generated by theCreateDatabaseScript
function was missingON DELETE
andON 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 usingCommandType.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 asBIT
. (Bug #13916560)Any sequence of
Take(
method calls followed byn
)Count
orLongCount
would cause aSystem.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 ofVARBINARY(
.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 functionProfileManager.DeleteProfiles
could throw anInvalidCastException
exception. (Bug #13790123, Bug #64470)A timing issue with the
GetItemExclusive
,SetAndReleaseItemExclusive
, andGetItem
functions could cause an application to freeze for almost 2 minutes ifGetItem
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 asVARCHAR
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:
db.Authors.Include("Books.Editions").AsEnumerable().First();
(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 assemblyMicrosoft.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. WhenenableSessionExpireCallback
is enabled, theglobal.asax.session_end
event is raised before data is deleted from themy_aspnet_sessions
table. WhenenableSessionExpireCallback
is disabled, the data is deleted from themy_aspnet_sessions
table without raising the event first. The timeout period for session expiry is specified in theweb.config
file, in thetimeout
option of thesessionState
section. (Bug #13354935, Bug #62266)