Issue 81921 - [cws dba24a] mysql odbc releations design: error when close dialog with OK
Summary: [cws dba24a] mysql odbc releations design: error when close dialog with OK
Status: CONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: recent-trunk
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
: 81927 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-09-25 09:24 UTC by marc.neumann
Modified: 2013-08-07 15:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description marc.neumann 2007-09-25 09:24:16 UTC
I use
- Linux
- mysql 5.0.18
- mysql-connector-odbc-3.51.20-0
- the tables are create with this SQL command:
drop TABLE if EXISTS rel1 ;
CREATE TABLE `rel1` (
  `id` int(11) NOT NULL,
  `text_1` varchar(20) default NULL,
  `text_2` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; 

drop TABLE if EXISTS rel2;
CREATE TABLE `rel2` (
  `id` int(11) NOT NULL,
  `text_1` varchar(20) default NULL,
  `text_2` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; 

1. open a database with type mysql and ODBC to connect to the mysql server 
2. open TOOLS / RELATIONS
3. add table rel1 and rel2
4. d&d id field from rel1 to rel2
5. double click the relation
6. close the dialog with OK
==>> error messages: You have an error in your SQL syntax: 'CONSTRAINT 'NULL''
Comment 1 ocke.janssen 2007-09-25 12:41:20 UTC
Driver problem. The driver doesn't return the name of the foreign key. So we can
not drop it.
Comment 2 ocke.janssen 2007-09-25 12:43:12 UTC
*** Issue 81927 has been marked as a duplicate of this issue. ***
Comment 3 ocke.janssen 2008-02-13 09:39:09 UTC
SQLForeignKeys returns for a foreign key the name 'NULL'. Afterwards when trying
to delete the foreign key the name 'NULL' is not accepted in 

ALTER TABLE 'x' DROP FOREIGN KEY 'NULL'

So I assume that the name of the foreign key is wrong. 
Tested with a 3.51.23.00 (version 5.1 hangs under Windows)
Comment 4 Frank Schönheit 2008-02-13 12:58:05 UTC
Seems this is reported in MySQL's bug database as
http://bugs.mysql.com/bug.php?id=25772. Which is marked as duplicate of issue
http://bugs.mysql.com/bug.php?id=19923, which IMO describes another problem.

Besides this, there is a comment in #m25772# which claims the behaviour is
correct, pointing to http://msdn2.microsoft.com/en-gb/library/ms709315.aspx,
where the respective text portion reads "Foreign key name. NULL if not
applicable to the data source.". However, neither in the ODBC documentation nor
in the MySQL-issue is an explanation what "not applicable to the data source" means.