Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing
|Summary:||[cws dba24a] mysql odbc releations design: error when close dialog with OK|
|Component:||code||Assignee:||AOO issues mailing list <issues>|
|Status:||CONFIRMED ---||QA Contact:|
|Issue Type:||DEFECT||Latest Confirmation in:||---|
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.