Bug #62289 Connector/NET producing NullReferenceException when trying to generate SQL
Submitted: 29 Aug 2011 0:32 Modified: 6 Nov 2011 22:34
Reporter: Andrew Houghton Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.3.7, 6.4.3 OS:Windows (Windows 7)
Assigned to: Assigned Account CPU Architecture:Any
Tags: .net Connector, 6.3.7, 6.4.3, entity framework, regression

[29 Aug 2011 0:32] Andrew Houghton
Description:
When trying to generate SQL from an entity framework query the MySql.Data.Entity.dll is producing a System.NullReferenceException.

This occurs when using Versions 6.3.7 and 6.4.3 but not 6.3.6 of the .NET Connector.

This appears to occur only when using sub joins in an entity framework query (i.e.   .Include("document") will work fine but .Include("document").Include("document.documentproperties") will produce an error)

Note: This error appears to be related to the following submitted bug:

http://bugs.mysql.com/bug.php?id=61729

How to repeat:
I've isolated the code into a demonstration project, please refer to the attached solution in next post for demonstration code.

Steps to setup demonstration project:

1. Create demo database schema using the 'Create Demo Database Schema.sql' contained in the MySQLBug.Entity project under Scripts

2. Adjust the connection string parameters in the App.config file of the MySQLBug.WPFUI project to point to your development database.

3. Run the MySQLBug.WPFUI project using the 6.4.3 MySQL .NET connector and it will display the error

Suggested fix:
Investigate changes made between the 6.3.6 and 6.3.7 connectors to determine what was changed that is now causing an error.

Thank you!
[29 Aug 2011 0:33] Andrew Houghton
Solution Project Demonstrating Issue

Attachment: MySQLBug.zip (application/x-zip-compressed, text), 198.67 KiB.

[29 Aug 2011 0:33] Andrew Houghton
Error Message Generated

Attachment: Error Message.txt (text/plain), 3.48 KiB.

[29 Aug 2011 0:34] Andrew Houghton
Stack Trace of Error

Attachment: Stack Trace.txt (text/plain), 3.40 KiB.

[6 Oct 2011 22:34] Fernando Gonzalez.Sanchez
Thanks for the very clear report,

However I couldn't reproduce it. Looks like it was effectively fixed in http://bugs.mysql.com/bug.php?id=61729 for the release v6.4.4.

Andrew, can you confirm this?

Thanks.
[7 Nov 2011 0: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".