Functionality Added or Changed
When defining an entity with a
DatabaseGeneratedOption.Identity value with
Entity Framework Code First, you can now leave this column out
of the column list for an INSERT
or UPDATE statement. This feature
is especially useful for defining a column with a default value
corresponding to the CURRENT_TIMESTAMP()
return value:
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public DateTime DateCreated { get; set; }
(Bug #15935094)
Connector/Net now supports the MySQL 5.6 feature to store
connection-specific data in the server. A Connector/Net
application can supply to the server a list of key/value pairs
at login time. When you specify the connection option
Connect_Attrs, a predefined set of attribute
values is sent to the server.
Connector/Net automatically transmits the following attributes:
_pid
_client_version
_platform
_program_name
_os
_thread
To examine these connection-specific attributes on the server, query the Performance Schema tables described in Performance Schema Connection Attribute Tables. (Bug #15935112)
Connector/Net now supports the MySQL 5.6 password expiration
protocol. See ALTER USER for the
syntax to expire the password for a user. When you open a
connection through Connection/Net that logs in as a user with an
expired password, any statement issued through the connection
produces a SET PASSWORD exception. When you
create a connection in Visual Studio Server Explorer to a user
with an expired password, a dialog prompts for a new password,
after which the connection succeeds.
(Bug #15935104)
Connector/Net now supports SHA-256 hashing for user account passwords. After you create an account following the steps outlined in The SHA-256 Authentication Plugin, just open a Connector/Net connection passing user and password. This feature works in both SSL and non-SSL secured connections. (Bug #15935128)
Bugs Fixed
Setting cascadeDelete to
true in
DbMigration.AddForeignKey() results in
ON DELETE RESTRICT
foreign key constraints
in generated DDL, rather than
ON DELETE CASCADE as expected.
(Bug #16398432, Bug #68457)
When running a multithreaded service, you might receive the exception:
The given key was not present in the dictionary
The issue was fixed by enhancing the locking code within the
ConnectionStringBuilder class.
(Bug #16310698, Bug #68217)
When using EntityFramework 4.3 and Code First, generated
foreign key identifiers
could be longer than 64 characters, causing
MySQLException errors. The fix renames any
too-long identifiers using the name format
FK_, where
guidguid is a global unique identifier
generated at runtime.
(Bug #16286397, Bug #67285)
Connector/Net would throw a MySqlException
exception when an invalid collection was passed to the
GetSchema method. Now it throws an
ArgumentException when an invalid collection
name is passed to GetSchema, to be compliant
with the API spec of
System.Data.Common.DbConnection.GetSchema.
The new behavior provides better compatibility with other data
access providers such as ADO.Net.
(Bug #16271425, Bug #67901)
When debugging a stored routine containing a
DECIMAL variable, you might encounter the
error:
mismatched input ')' expecting COMMA
A workaround was to include a second parameter of 0 in the variable declaration:
DECLARE var_name DECIMAL(3, 0)
The fix allows the Connector/Net debugger to handle
DECIMAL variable declarations without the
optional second field.
(Bug #16079735, Bug #67975)
If a DateTime type in MySQL 5.6
was defined with milliseconds precision using Entity Framework
Code First or EF Model First, the expected
DateTime( column
did not include the precision specification.
(Bug #15972773)n)
Specifying the Default Command Timeout option
in a connection string used with the MySQL Entity Framework
provider had no effect. The command timeout was always 30
seconds.
(Bug #14825670, Bug #67171)
A System.InvalidCastException exception could
occur when calling a stored function. A workaround was to
specify the CheckParameters=false connection
option.
(Bug #13864627, Bug #64633)
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 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)
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)
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)
Calling the method FirstOrDefault “LINQ
to Entities” queries caused a
System.Data.EntityCommandCompilationException
exception.
(Bug #15856964, Bug #67377)
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 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 would fail 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)
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)
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)
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)
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)
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 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)
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-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 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 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( method
calls followed by n)Count or
LongCount would cause a
System.Data.EntityCommandCompilationException
error.
(Bug #13913047, Bug #64749)
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)
When using the MySqlProfileProvider, calling
the function ProfileManager.DeleteProfiles
could throw an InvalidCastException
exception.
(Bug #13790123, Bug #64470)
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 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 instead, which is upward compatible with later Visual
Studio versions.
(Bug #13491674, Bug #63073)
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)
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)
First GA release for Connector/NET 6.5.
Bugs Fixed
In Visual Studio Table Designer, if you tried to save a new table using an existing table name, subsequently you would not be prompted to choose a new name, preventing you from saving the table. (Bug #13785918)
When creating a Visual Studio Web Application Project, using the ADO.NET Entity Data Model and generating the model from a database, the Entity Framework Model was not created. This operation gave an error:
Access denied for user 'root'@'localhost' (using password: NO)
(Bug #13610452)
When creating a project in VisualStudio using a .NET framework
such as 3.0 or 3.5 (anything less than 4.0), the Connector/Net
library (MySql.Data.dll) was not listed in
the Add References dialog box. The
workaround was to browse to the library and add it manually.
(Bug #13491678, Bug #60462)
Second Release Candidate (RC) release.
Bugs Fixed
The performance when setting the CommandText
property on the MySqlCommand class was
improved by enhancing the efficiency of a string comparison
operation.
(Bug #13739383, Bug #64012)
Fixed MySqlTime parsing to avoid throwing an
exception when handling milliseconds (as result of a
timediff operation).
(Bug #13708884, Bug #64268)
In Visual Studio Table Designer, when adding a second foreign key, the new name was incorrectly assigned to the first foreign key in the list. (Bug #13613824)
In Visual Studio Table Designer, changes to a field were sometimes not detected until you switched focus away from that field. (Bug #13613755)
First Release Candidate (RC) release.
Bugs Fixed
In Visual Studio Table Designer, when editing a foreign key relationship, choosing a column name on the left side made that column name unavailable on the right side. (Bug #13615258)
In Visual Studio Table Designer, an error could occur if you added and deleted column information for foreign keys in a particular sequence. (Bug #13610235)
In Visual Studio Table Designer, deleting a foreign key relationship in the Relationship dialog required clicking twice. (Bug #13610283)
In Visual Studio Table Designer, modifying the Columns field in the Indexes/Keys dialog multiple times could cause an error. (Bug #13613765)
In Visual Studio Table Designer, it was possible to save a new foreign key relationship without filling in the fields of the Foreign Key Relationship dialog. (Bug #13613839)
In Visual Studio Table Designer, changing the length of a
VARCHAR field could cause an error.
(Bug #13611677)
If MySqlCommand.CommandText was equal to
null, then
MySqlCommand.ExecuteReader() would throw the
wrong exception: NullReferenceException
instead of InvalidOperationException.
(Bug #13624659, Bug #64092)
When using connection pooling, the connections in the pool were
not automatically closed upon application exit. With the setting
log-warnings=2, you could encounter
Aborted connection errors in the MySQL error
log. The workaround was to explicitly call
MySql.Data.MySqlClient.MySqlConnection.ClearAllPools();
upon exiting the application.
(Bug #13629471, Bug #63942)
The MySQL script generated by using the function
CreateDatabaseScript used names with
incorrect singular/plural forms.
(Bug #13582837, Bug #62150)
In Visual Studio Table Designer, the Add -> Function Import... dialog could close prematurely when you pressed the Get Column Information button. (Bug #13511736)
When designating a primary key for a table in Table Designer, the key icon could fail to appear until the Table Designer was restarted. (Bug #13481246)
Second beta release.
Bugs Fixed
In Table Designer for Visual Studio, trying to delete
foreign keys from an
InnoDB table showed an error, and the change
was not saved.
(Bug #13481362)
After an UPDATE statement,
Connector/Net would generate incorrect
SELECT SQL statements if a value
in the WHERE clause was not also present in
the SET clause of the
UPDATE.
(Bug #13491689, Bug #62134)
IntelliSense would emit an error when the "-"
(minus) character was typed.
(Bug #13522344)
First beta release.
Functionality Added or Changed
Added better IntelliSense support, including auto-completion
when editing stored procedures or .mysql
files. For more information, see
Using IntelliSense in the SQL Editor.
Adds a MySqlClientPermission class to help
users define the security policies for the database connections
within any application using a MySQL database.
Added better partial-trust support, thus allowing Connector/NET to run in a partial trust scenario. It will work correctly in a medium-trust level environment when the library is installed in the GAC. For more information, see Working with Partial Trust / Medium Trust.
Added fractional seconds support, as per MySQL Server 5.6 and above. For more information, see Fractional Seconds in Time Values
Added “interceptor” classes for exceptions and commands. For more information, see Using the Connector/Net Interceptor Classes.
Bugs Fixed
The MySqlDataReader.GetDateTime() method was
not recognizing that TIMESTAMP values had
already been converted to the local time zone of the MySQL
server, which could cause incorrect results if the value was
later processed through the ToLocalTime()
method. The fix causes the Kind property to
be correctly set to Local rather than
Unspecified.
(Bug #13591554, Bug #63812)
Visual Studio 2010 Table Designer could give an error
“Object reference not set to an instance of an
object” for schemas with certain combinations of column
names and foreign key references. The SQL syntax was incorrect
for the ALTER TABLE statement
generated by the Table Designer.
(Bug #13591545, Bug #63714)
