Bug #102937 EnsureCreatedAsync breaking by CreateHasTablesCommand result int32 vs int64
Submitted: 11 Mar 21:41 Modified: 25 Apr 12:22
Reporter: Raul Robledo Medellin Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:8.0.0.23 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[11 Mar 21:41] Raul Robledo Medellin
Description:
When user executes EnsureCreatedAsync to create database with package MySql.EntityFrameworkCore 5.0.0+MySQL8.0.23 the following exception is generated

Unable to cast object of type 'System.Int64' to type 'System.Int32'.

which is generated when trying to cast CreateHasTablesCommand to Int32

How to repeat:
 - Start a new dotnet core project
 - Add nuget packages for Microsoft.EntityFrameworkCore 5.0.4 and MySql.EntityFrameworkCore 5.0.0 (8.0.23)
 - Define entity
 - Define DbContext with new entity
 - Initialize the context with valid connection string
 - Run Context.Database.EnsureCreatedAsync()

Suggested fix:
Cast result of CreateHasTablesCommand to Int64/long in EFCore5/src/Storage/Internal/MySQLDatabaseCreator.cs
[25 Mar 12:22] MySQL Verification Team
Hello Raul Robledo Medellin,

Thank you for the bug report.
Could you please provide a complete test case and code file which hit the issue reported? Thanks.

Regards,
Ashwini Patil
[26 Apr 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".