Bug #86187 | WHERE IN not mapped with Entity Framework Core | ||
---|---|---|---|
Submitted: | 4 May 2017 19:30 | Modified: | 31 May 2017 13:57 |
Reporter: | Maxime Beaudry | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 7.0.7-m61 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[4 May 2017 19:30]
Maxime Beaudry
[8 May 2017 9:39]
Chiranjeevi Battula
Hello Maxime Beaudry, Thank you for the bug report. I could not repeat the issue at our end using with Visual Studio 2015, Connector/NET 7.0.7-m61 version. Could you please provide repeatable test case (exact steps/sample project, screenshot etc. - please make it as private if you prefer) to confirm this issue at our end? Thanks, Chiranjeevi.
[8 May 2017 13:07]
Maxime Beaudry
Maybe I didn't explain properly. There is no functional problem. There is a performance problem. All the queries return the expected object. But if you enable the MySql general logs, you will see the following queries: ==> this is generated by context.Demos.ToList(); 4 Query SELECT `d`.`Id`, `d`.`Key` FROM `Demos` AS `d` ==> this is generated by context.Demos.Where(x => nullableIds.Contains(x.Id)).ToList() ==> It generates the SQL that I want. 170508 9:04:50 4 Init DB bugdemo 4 Query SELECT `x`.`Id`, `x`.`Key` FROM `Demos` AS `x` WHERE `x`.`Id` IN (2, 5, 200) ==> This is generated by context.Demos.Where(x => nonNullableIds.Contains(x.Id.Value)).ToList() ==> It generates a sub-optimal query since the filtering is done in memory. This is where I would ==> like to have the MySql driver generate a warning / error. 170508 9:04:55 4 Init DB bugdemo 4 Query SELECT `x`.`Id`, `x`.`Key` FROM `Demos` AS `x` Can you confirm that you see these entries in your MySql general logs?
[9 May 2017 5:32]
Chiranjeevi Battula
Hello Maxime Beaudry, Thank you for the feedback. Verified this behavior on Visual Studio 2015 (C#.Net) and Connector/NET 7.0.7-m61 version. Thanks, Chiranjeevi.
[9 May 2017 5:34]
Chiranjeevi Battula
170509 6:34:16 5 Connect root@localhost on test 5 Query SHOW VARIABLES 5 Query SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP()) 5 Query SHOW COLLATION 5 Query SET character_set_results=NULL 5 Init DB test 5 Query SELECT `d`.`Id`, `d`.`Key` FROM `Demos` AS `d` 170509 6:34:19 5 Init DB test 5 Query SELECT `x`.`Id`, `x`.`Key` FROM `Demos` AS `x` WHERE `x`.`Id` IN (2, 5, 200) 170509 6:34:21 4 Query SHOW GLOBAL STATUS 170509 6:34:24 5 Init DB test 5 Query SELECT `x`.`Id`, `x`.`Key` FROM `Demos` AS `x` 170509 6:34:32 5 Quit
[31 May 2017 13:57]
Maxime Beaudry
Any update?