Bug #76663 Unknown column 'Extent1.product_idProduct' in 'where clause'
Submitted: 11 Apr 2015 0:52 Modified: 3 Dec 2016 1:17
Reporter: Diogo Piçarra Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.9.5, 6.9.6, 6.9.9 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[11 Apr 2015 0:52] Diogo Piçarra
Description:
Since one of the last Connector updates e always get the error:
Unknown column 'Extent1.product_idProduct' in 'where clause'

Related to the third line on this code:
 var randomizer = new Random(DateTime.Now.Millisecond);
var bestSelling = db.product_multilanguage.Where(p => p.product_id_language == 1 && p.product.product_active).OrderByDescending(p => p.product.order_line.Where(o => o.order.created > before && o.order.valid).Sum(o => o.quantity)).Take(10);
var threebestSelling = bestSelling.AsEnumerable().OrderBy(rand => randomizer.Next()).Take(3).ToList();

I tried with version 6.9.3 and 6.9.4 and it doesn't work but used to work.

How to repeat:
Run this code:
 var randomizer = new Random(DateTime.Now.Millisecond);
var bestSelling = db.product_multilanguage.Where(p => p.product_id_language == 1 && p.product.product_active).OrderByDescending(p => p.product.order_line.Where(o => o.order.created > before && o.order.valid).Sum(o => o.quantity)).Take(10);
var threebestSelling = bestSelling.AsEnumerable().OrderBy(rand => randomizer.Next()).Take(3).ToList();
[13 Apr 2015 12:32] Chiranjeevi Battula
Hello Diogo Piçarra,

Thank you for the bug report.
Could you please provide repeatable test case (exact create table statements, and data etc - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[15 Apr 2015 10:12] Chiranjeevi Battula
Hello Diogo Picarra,

Thank you for providing requested data, but observed that one of the required table "order" is missing from the provided test case. Could you please include that as well? 

Thanks,
Chiranjeevi.
[16 Apr 2015 7:17] Chiranjeevi Battula
Hello Diogo Picarra,

Thank you for your feedback.
Verified this behavior on Visual Studio 2013 (C#.Net) with  MySQL Connector/Net 6.9.6.

Thanks,
Chiranjeevi.
[30 May 2015 23:41] Diogo Piçarra
I had this problem with EntityFramework 6.1.3. Now i'am using EF 6.1.1 and it works. I guess it is an EF bug or connector/NET incompatibility.
[29 Sep 2015 6:05] Chiranjeevi Battula
http://bugs.mysql.com/bug.php?id=78610 marked as duplicate of this one.
[14 Sep 2016 8:27] Chiranjeevi Battula
http://bugs.mysql.com/bug.php?id=82982 marked as duplicate of this one.
[3 Dec 2016 1:17] Diogo Piçarra
Now i'am getting this error randomly. Yesterday the site was working today is not. Without changes.
I've tried both 6.1.1 and 6.1.3 versions of EF with MySQL connector version 6.9.9 and none of them works.