Bug #104540 Mysql.Data 8.0.27 - Entity framework
Submitted: 4 Aug 2021 17:16 Modified: 4 Dec 2021 12:42
Reporter: Matasci Sacha Email Updates:
Status: Analyzing Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:8.0.27 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[4 Aug 2021 17:16] Matasci Sacha
Description:
After updating to mysql.data 8.0.26 the schema is replicated.
In mysql.data 8.0.20 worked well. I can't upgrade to 8.0.26 because it was a bug with the stored procedure.

Exception: 'MySql.Data.MySqlClient.MySqlException' in MySql.Data.dll
Table 'dbname.user.table' doesn't exist

See bug #101236 and @#103411

How to repeat:
// 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.table' doesn't exist'
[11 Aug 2021 13:11] MySQL Verification Team
Hello Matasci Sacha,

Thank you for the bug report.
Could you please provide a complete test project so that we can replicate the exact same issue since this has different approaches and it seems that we are not in the same page.

Regards,
Ashwini Patil
[11 Aug 2021 16:21] Matasci Sacha
The problem, is the same like other bugs report. It was unsolved since version 8.0.21
[18 Sep 2021 13:07] Dean Turnbull
I concur with Matasci's report, I have also updated his last bug report on this. For me it seems to be isolated to VIEWS only.

The view name in the query statement is being replicated resulting in;

   DATABASE.DATABASE.VIEW

   instead of just

   DATABASE.VIEW 

   or 

   VIEW

This results in a SQL statement of 

   select .... from DATABASE.DATABASE.VIEW where .... 
 
   which is obviously wrong as it should be

   select .... from DATABASE.VIEW where ....

Changing the value in the XML (similar to another users report in the last bug) as follows resolves the issue;

   <EntitySet Name="VIEW" EntityType="Self.VIEW" store:Type="Views" store:Schema="DATABASE">

   changed to

   <EntitySet Name="VIEW" EntityType="Self.VIEW" store:Type="Views" store:Schema="">

This bug exists in 8.0.26
[4 Dec 2021 12:42] Matasci Sacha
Hi,
the bug still exists on version 8.0.27....
It is planned to solve it?
It is from version 8.0.21 that exist it....

Thank you for an answer.
[6 Dec 2021 5:38] Kai Neumann
Information for the developers: 
The bug 101236 has a better discription of the problem than this (104540) but it was unfortunately closed.