Bug #101236 Mysql.Data 8.0.22 - Entity framework
Submitted: 20 Oct 2020 8:30 Modified: 25 Jan 23:26
Reporter: Matasci Sacha Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:8.0.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: Visual Studio

[20 Oct 2020 8:30] Matasci Sacha
Description:
After updating to mysql.data 8.0.22 the schema is replicated.
In mysql.data 8.0.20 worked well. I can't upgrade to 8.0.21 because it was a bug with the stored procedure.

Exception: 'MySql.Data.MySqlClient.MySqlException' in MySql.Data.dll
Table 'sport_reservation.sport_reservation.tbl_dictionaries' doesn't exist

How to repeat:
Upgrade to 8.0.22.

Suggested fix:
Remove the replicated schema name.
[20 Oct 2020 9:10] MySQL Verification Team
Hello Matasci Sacha,

Thank you for the bug report.
Could you please provide the test case file to reproduce at our end?

Regards,
Ashwini Patil
[20 Oct 2020 11:12] Matasci Sacha
This is the code I've always used. Nothing is changed from the previous version.

// Initialize the connection string builder for the underlying provider.
var sqlBuilder = new MySqlConnectionStringBuilder
{
    Server = "servername",
    Database = "dbname",
    UserID = "user",
    Password = "password",
    PersistSecurityInfo = true,
    SslMode = MySqlSslMode.None 
};

// Initialize the EntityConnectionStringBuilder.
var entityBuilder = new EntityConnectionStringBuilder
{
    Provider = "MySql.Data.MySqlClient",
    ProviderConnectionString = sqlBuilder.ToString(),
    Metadata = @"res://*/LocalizationService.Database.DBModel.csdl|res://*/LocalizationService.Database.DBModel.ssdl|res://*/LocalizationService.Database.DBModel.msl"
};

_entityconnessione = new EntityConnection(entityBuilder.ToString());

This is the connection string generated...
metadata=res://*/Database.DBModel.csdl|res://*/Database.DBModel.ssdl|res://*/Database.DBModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=server;database=dbname;user id=user;password=password;port=3306;sslmode=None;persistsecurityinfo=True"

This is the exception
MySql.Data.MySqlClient.MySqlException: 'Table 'dbname.user.tbl_dizionario' doesn't exist'
[21 Oct 2020 5:55] Matasci Sacha
Hi, 
if you see my code below, there isn't any duplicated schema.
I didn't change my code, i've just upgraded to the 8.0.22 mysql library version.
[21 Oct 2020 5:57] Matasci Sacha
In the example.

sport_reservation.sport_reservation.tbl_dictionaries

the first sport_reservation is the schema
the second sport_reservation is the username
[30 Oct 2020 7:31] MySQL Verification Team
Bug #101384 marked as duplicate of this one.
[26 Nov 2020 5:39] zb c
I got same bug. Downgrade NuGet MySql.Data.EntityFramework from 8.0.22 to 8.0.21 can solve the bug.
[6 Jan 5:43] MySQL Verification Team
Hello Matasci Sacha,

Thank you for the feedback.
The code given is not enough to reproduce the error. Could you please provide more information including stack trace of the exception.

Regards,
Ashwini Patil
[6 Jan 9:54] zb c
I upload a project for reproducing, hope this helps.
https://github.com/zzbbcc/MySQL_Bug_101236

You can find more explanation and dump there.
[6 Jan 15:27] Tom M.
I got the same bug when I upgraded to MySql.Data.EntityFramework 8.0.22. I had to rollback to the 8.0.21 version.

With the 8.0.22 version, I have this type of error :
"Table 'database2.database1.mytable' doesn't exist"
(the right path to the table is "database2.mytable")

I created my EF schema using "Database first", on the database "database1".
Throught the connection string of my project, I'm connected to a different database (same database schema, but different name), "database2".
[8 Jan 5:44] MySQL Verification Team
Hello,

Thank you for the detailed project.
Discussed this issue internally with the Connector/NET developer and confirmed that C/NET 8.0.22 is affected. Thank you!

Regards,
Ashwini Patil
[22 Jan 17:40] Matasci Sacha
Hi,

I saw you have updated the version to 8.0.23, but the problem still remain.
It is correct?

Thank you for your support.
[25 Jan 23:26] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/NET 8.0.24 release, and here's the proposed changelog entry from the documentation team:

A data table declared using valid database.table syntax within an Entity
Framework model could have extra database names in the generated query
(for example, database.database.table).

Thank you for the bug report.
[18 Feb 13:12] MySQL Verification Team
Bug #102576 marked as duplicate of this one.
[24 Apr 17:48] Rob Janssen
Updated to 8.0.24
Getting data from database works.
But when saving data I still get the error:
Table database.database.table does not exists.
I'm using a UnitOfWork with a Commit
[26 Apr 9:55] Tom M.
With the 8.0.24 version, reading data from the database is still KO for me.
It keeps trying accessing to that kind of path : database1.database2.mytable
[13 May 16:25] Pablo Mazza
This is not resolved in 8.0.24.
[13 May 16:25] Pablo Mazza
This is not resolved in 8.0.24.