Bug #62134 | Connector/Net Generates Incorrect SELECT Clause after UPDATE | ||
---|---|---|---|
Submitted: | 10 Aug 2011 0:15 | Modified: | 29 Feb 2012 21:01 |
Reporter: | Alexander Nagy | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 6.4.3 | OS: | Any |
Assigned to: | Fernando Gonzalez.Sanchez | CPU Architecture: | Any |
[10 Aug 2011 0:15]
Alexander Nagy
[16 Aug 2011 10:10]
Bogdan Degtyariov
Hi Alexander, I installed Entity Framework 4.1 and tried to make a sample test case using your instructions. Visual Studio displayed the error: The type or namespace name 'ConcurrencyCheck' could not be found (are you missing a using directive or an assembly reference?) for [ConcurrencyCheck, Required, MaxLength(45)] Is that a part of your code? I tried looking into the docs for more details about ConcurrencyCheck and could not find anything relevant to our case. Thanks.
[16 Aug 2011 16:56]
Alexander Nagy
Hi Bogdan, the error you are seeing is when the assembly System.ComponentModel.DataAnnotations.dll needs to be added to the project. ConcurrencyCheckAttribute was added in .Net 4, here is the MSDN link: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.concurrencyc.... The general DataAnnotations namespace can be found here: http://msdn.microsoft.com/en-us/library/cc490428.aspx (Entity Framework 4.1 and later use these). All the best, Alex
[22 Aug 2011 9:26]
Bogdan Degtyariov
Alexander, Thanks for your reply. I had System.ComponentModel.DataAnnotations in using section, but forgot to add to the project references. Now I am able to reproduce the exception: {"Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries."} Uploading the test project to avoid further confusions.
[22 Aug 2011 9:32]
Bogdan Degtyariov
Test project
Attachment: bug62134.zip (application/zip, text), 16.22 KiB.
[17 Jan 2012 16:50]
Fernando Gonzalez.Sanchez
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at http://www.mysql.com/downloads/ This fix will appear in versions 6.3.9, 6.4.5 & 6.5.1.
[29 Feb 2012 21:01]
John Russell
Added to changelog for 6.3.9, 6.4.5, 6.5.1: After an UPDATE statement, Connector/Net would generate incorrect SELECT SQL statements if a value in the WHERE clause was not also present in the SET clause of the UPDATE.