Incorrect SQL generated by Pomelo with MySQL and .NET Core

.net-core c# entity-framework-core mysql

Question

I've been using Pomelo and.NET Core. EntityFrameworkCore.MySql (v1.1.2, it is not the newest but I would want to remain on it for different reasons) (v1.1.2, it is not the latest but I would prefer to stay on it for various reasons).

When I start my project, I suddenly see an issue since I was reworking the model classes and adding a child-parent connection (e.g., Order has a Customer).

2019-09-16T12:36:49.8158085-07:00 0HLPQRKH27D40 [INF] Executed DbCommand (6ms) [Parameters=[], 

CommandType='Text', CommandTimeout='0']
INSERT INTO `Order`
DEFAULT VALUES;
SELECT LAST_INSERT_ID(); (6438bdd5)
2019-09-16T12:36:49.9249074-07:00 0HLPQRKH27D40 [ERR] An exception occurred in the database while saving changes.
 (3b5ca34b)
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES;

The usage of seems to be the issuedefault values in insert into 'order' default values; as a result of MySQL 21-zzz. Mysql 5.1 is the development version I'm using, but it doesn't seem to matter since it doesn't seem to be in subsequent versions.

I (naively) looked at the Pomelo source code, but all I discovered was a unit test that used "DEFAULT VALUES."

1
0
9/17/2019 3:41:56 AM

Accepted Answer

ZZZ_tmp
0
11/27/2019 4:00:16 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow