Bug #48974 "REFERENCED_TABLE_CATALOG does not belong to table" in VS2008 DataSet Designer
Submitted: 22 Nov 2009 20:12 Modified: 16 Dec 2009 11:19
Reporter: José Francisco RangelSerrano Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.2.1 OS:Any
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: Connector/Net, REFERENCED_TABLE_CATALOG

[22 Nov 2009 20:12] José Francisco RangelSerrano
Description:
I'm using Visual Studio 2008 Full Edition (Spanish version), Windows XP SP3 connecting to
MySQL 5.1, all on the same computer. I design my database with MySQL Workbench and export
to MySQL Server 5.1. 

I have installed version 6.2.1 of connector .NET. (I have tried it with other last versions too)

But with this version I have a similar problem: "Add New Data Source", select "Database",
select the data connection to your MySql database, save your connection string, and
finally select the tables for your DataSet. When adding the DataSet, VS2008 will give an
error that says "Relations couldn`t be addded. 
Column 'REFERENCED_TABLE_CATALOG' does not belong to table.", but the tables will be
added.

For months I wait.

I'm desperate.

Please, help me.

How to repeat:
Only you must try to create a new DataSet. Only it.

Using version 6.2.1 or olders of the Connector/NET in Visual Studio 2008.  Link to a MySQL database
(InnoDB) with multiple tables that contain foriegn key linkages.  Add a few tables to the
DataSet designer and this error should happen.

Suggested fix:
I don't know.
[24 Nov 2009 8:25] Tonci Grgin
Hi José and thanks for your report. We will continue discussion here.

First of all, please do mysqldump (you can omit the data, I just need structures) of database in question and attach it to this report. Make sure the procedure you described fails with attached dump! Do you have any referential constraints longer than 80 characters?
I will also need MySQL server version you're using.
[6 Dec 2009 19:25] Bug me Not
The error appears, if you try to drop the table "projectcontacts" into a Dataset in VS 2008

Attachment: test2 20091206 1907.sql (application/octet-stream, text), 3.62 KiB.

[6 Dec 2009 19:54] Bug me Not
Sorry for the Username from the last post.
I tried to post with my new added account "Michael Uray" but i just got the following message:
"An error occured when trying to verify your login credentials Please log out and try again."
So i used a bug me not login for the post with this name.

Ok, back to the problem:
The error description from my last post was'nt exactly.
The error appears, when you add the table "projectcontacts" and an other table from from the db to the dataset.
[7 Dec 2009 7:46] Tonci Grgin
No problem :-)
[8 Dec 2009 9:33] Tonci Grgin
Michael, this could be due to table `projects` being created after table `projectcontacts` thus 
CONSTRAINT `FK_projectID` FOREIGN KEY (`projectID`) REFERENCES `projects` (`projectID`) ON DELETE CASCADE ON UPDATE CASCADE
might fail to create...

Will check now with reversed order in your DDL file (projects before projectcontacts).
[8 Dec 2009 9:42] Tonci Grgin
Verified as described with script provided by Michael.

Env:
  o W2K8SE x64 with .NET FW 3.5.
  o VS2008Pro, c/NET 6.2.1
  o Remote MySQL server 5.1.31x64 on OpenSolaris box.
[8 Dec 2009 9:42] Tonci Grgin
SS of problem.

Attachment: Bug48974.jpg (image/jpeg, text), 94.60 KiB.

[9 Dec 2009 18:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93374

779 Reggie Burnett	2009-12-09
      - Fixed problem caused by us not including a 'REFERENCED_TABLE_CATALOG' column in our
        foreign keys collection (bug #48974)
[9 Dec 2009 18:35] Reggie Burnett
fixed in 6.0.6, 6.1.4, 6.2.2, and 6.3+
[9 Dec 2009 18:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93376

796 Reggie Burnett	2009-12-09 [merge]
      Fixed problem caused by us not including a 'REFERENCED_TABLE_CATALOG' column in our  foreign keys collection (bug #48974)
[9 Dec 2009 18:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93378

814 Reggie Burnett	2009-12-09 [merge]
      Fixed problem caused by us not including a 'REFERENCED_TABLE_CATALOG' column in our  foreign keys collection (bug #48974)
[9 Dec 2009 18:38] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93380

810 Reggie Burnett	2009-12-09 [merge]
      Fixed problem caused by us not including a 'REFERENCED_TABLE_CATALOG' column in our  foreign keys collection (bug #48974)
[16 Dec 2009 11:19] Tony Bedford
An entry has been added to the 6.0.6, 6.1.4, 6.2.2, 6.3.0 changelogs:

When adding a data set in Visual Studio 2008, the following error was generated:

Relations couldn't be addded. Column 'REFERENCED_TABLE_CATALOG' does not belong to table.

This was due to a 'REFERENCED_TABLE_CATALOG' column not being included in the foreign keys collection.