Bug #18343 Crashes in multiple places when using MyODBC in Visual Studio Server Explorer
Submitted: 19 Mar 2006 19:55 Modified: 19 Mar 2006 23:42
Reporter: Andrew Cook Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.12 OS:Windows (Windows XP SP2)
Assigned to: MySQL Verification Team CPU Architecture:Any

[19 Mar 2006 19:55] Andrew Cook
Description:
Users of Visual Studio can view and manipulate views and stored procedures on any Microsoft SQL Server 7.0, 2000, or 2005 server they can connect to using Data Connections in the Server Explorer pane. Views are displayed in a "Views" "subfolder" of the schema, and stored procedures are similarly displayed in a "Procedures" "subfolder".

When using the ADO.NET Provider for ODBC in concert with MyODBC, the Views and Procedures subfolders also appear, but attempts to select or expand them cause a segmentation violation.

How to repeat:
1. Create a DSN pointing to a MySQL database using MyODBC.
2. Create a data connection to that DSN from Visual Studio.
3. In Server/Data/Database Explorer, select "ODBC.localhost via TCP/IP.whatever" where "whatever" is your DSN. Expand it.
4. Click the plus sign next to either Views or Procedures.

If you are using Visual Studio 2005, a dialog appears stating "Attempt to read or write protected memory. This often indicates that other memory is corrupt.."

If you are using Visual Studio 2002 or 2003, it crashes.

Confirmed using RTM of Visual Studio .NET 2002 Academic Edition (1.0.3300), RTM of Visual Studio 2003 Enterprise Architect Edition (1.0.5000), Beta 1 of Visual Basic Expression Edition (2.0.40607), Beta 2 of Visual Basic Express Edition (2.0.50215), and RTL of Visual Studio 2005 Standard Edition (2.0.50727).
[19 Mar 2006 20:04] Andrew Cook
Since submitting this bug, I've come across multiple similar bugs:

In Visual Studio 2003, attempts to view the columns of a table cause a crash.

In Visual Studio 2005, attempts to drag a table, column, or schema over a DataSet design surface cause an error dialog to appear identical to the one mentioned above.

In Visual Studio 2003, attempts to drag a table over a DataSet design surface cause a NullReferenceException in the OdbcDataAdapter. The exception is caught by Visual Studio and displayed in its own set of error dialogs.
[19 Mar 2006 20:34] MySQL Verification Team
Looking the view inside Visual Studio 2003

Attachment: bug18343.PNG (image/png, text), 23.55 KiB.

[19 Mar 2006 20:36] MySQL Verification Team
Thank you for the bug report. I was unable to repeat the behavior
reported with Visual Studio 2003. I created the below table and
view:

c:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.19-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database db23;
Query OK, 1 row affected (0.19 sec)

mysql> use db23
Database changed
mysql> create table tb (id int auto_increment not null primary key, col1 char(
Query OK, 0 rows affected (0.11 sec)

mysql> insert into tb (col1) values ("mary");
Query OK, 1 row affected (0.06 sec)

mysql> create view v as select * from tb;
Query OK, 0 rows affected (0.06 sec)

mysql> select * from v;
+----+------+
| id | col1 |
+----+------+
| 1  | mary |
+----+------+
1 row in set (0.05 sec)

Then created an DSN with 3.51.12 and followed your instructions
in VS 2003. I attached a picture displaying the view.
[19 Mar 2006 22:59] Andrew Cook
Yes, I'm noticing that behavior too. You can view views and manipulate their contents. However, I noticed that the title of the tab in that screenshot was v : Table. Looking in Server Explorer on my end, views appear as tables. Their queries cannot be edited, and attempting to expand the "Views" node still causes a crash (2002, 2003) or error message (2005).