Bug #69950 Visual Studio 2010 crashes when reading rows from any table in Server Explorer
Submitted: 7 Aug 2013 12:16 Modified: 26 Aug 2013 9:19
Reporter: Maria Fuchs Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.2.5 OS:Microsoft Windows (win7 64 bits)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: ODBC, visual studio 2010

[7 Aug 2013 12:16] Maria Fuchs
Local I have the MySql database and can connect with MySqlWorkbench. 
I have made a user-DSN and a system-DSN on the MySQL database.

In Visual Studio 2010 SP1 I try to make a server Explorer-Data-Connection with 'Microsoft ODBC Data Source (ODBC)' and select the system-data-source name and click OK.
Then I get the message 'Failed to call the ODBC driver connection utility'.

I have also tried connector net 6.7.4, but than on a click the window 'add connection' in VS2010 disappears. 
Connector odbc 5.1.12 does not fix the problem.

In VS2005 on winXP with MySQL odbc 3.51 I can make a connection.

Win7 64 bits was a new installation.

How to repeat:

win7 64bits
Install VS2010 and SP1
Install MySQL server
Install MySql connector odbc 5.2.5 winx64
Install MySql connector net 6.5.6
[9 Aug 2013 10:41] Bogdan Degtyariov
Hi Maria,

Thank you for your interest in MySQL software and for reporting a problem.
I have a few issues with understanding the nature of the issue.
As you mentioned, the bug occurred in MS Visual Studio 2010 SP1 and 64-bit MySQL Connector/ODBC driver 5.2.5. The Visual Studio process is a 32-bit one and therefore it cannot load 64-bit drivers. In fact the 64-bit DSN should not be displayed in the list at all.

Did you install a 32-bit driver?

With the 32-bit version of Connector/ODBC 5.2.5 I was able to connect to MySQL database and get the list of tables from there. There was a problem later when I tried to get data from any of the tables. The VS IDE had just closed. I am not sure whether it had crashed or not because the Windows log had no crash reports. Only a strange entry:

Aborted connection 269 to db: 'test' user: 'xxxxxxx' host: 'xxxxxxxx' (Got an error reading communication packets)

So, I am trying to understand what exactly we are dealing with.
[12 Aug 2013 8:32] Maria Fuchs
Hi Bogdan,

Thanks for your explaination. 
I hadn't the 32 bits odbc installed. 
After installing 32bits (next to the 64bitst already installed) I do get connection !

So thanks very much !
[13 Aug 2013 8:21] Bogdan Degtyariov

As mentioned, when verifying this bug I crashed the ODBC driver using the steps you provided. This problem requires our urgent and immediate attention. I hope you would have no objections against changing the bug synopsis.
I will keep you informed on the bug fixing progress.

[13 Aug 2013 8:51] Bogdan Degtyariov
The crash happens after a call of SQLTables() function that returns and empty result set. Then the STMT must be closed at once without trying reading the result or checking the status.
[13 Aug 2013 8:51] Bogdan Degtyariov
Test case

Attachment: my_crash.c (text/plain), 1.97 KiB.

[13 Aug 2013 11:21] Bogdan Degtyariov
Patch and test case

Attachment: bug69950.diff (application/octet-stream, text), 3.84 KiB.

[14 Aug 2013 8:15] Bogdan Degtyariov
The patch has been pushed into the source trees:

Connector/ODBC 5.1 revision 1104
Connector/ODBC 5.2 revision 1163
Connector/ODBC 5.3 revision 1174
[22 Aug 2013 16:20] Daniel So
Added the following entry to the Connector/ODBC 5.2.6 and 5.1.13 changelogs:

Microsoft Visual Studio 2010 crashed when reading rows from any table in Server Explorer with connections to DSNs made by Connector/ODBC.
[26 Aug 2013 9:19] Maria Fuchs
Hi Bogdan,

Where/when can I download this new version ODBC 5.2.6 ?