Created attachment 147959 [details] It's the relationship created by the native MySQL connector I am using the new built in native MySQL Connector. When creating a new relationship between two tables, rather than relating the foreign key of one table to the primary key of the other; a relationship is created between the foreign key and itself! This is seen in Tools > Relationship in the main database window where every primary-foreign relationship shows this. Example: "tableA"."primary key" should be related to "tableB"."foreign key" Instead: "tableB"."foreign key: is related to "tableB"."foreign key" The problems seems to be in the new MySQL connector. When connecting to the same database using either MySQL(JDBC) [mysql-connector-java-5.1.45, mysql-connector-java-8.0.13], Tools > Relationships shows the proper primary-foreign key pairs. The database was created in the following way: 1) Using the database wizard, I selected "Connect to an existing database and selected "MySQL from the drop down menu. 2) Selected "Connect directly" 3) I entered the database name and listed localhost as the server. 4) I entered my user name and checked "password required" 5) Selected "Yes, register the database for me." I checked "Open the database for editing."
Comment on attachment 147959 [details] It's the relationship created by the native MySQL connector The title of the snapshot is wrong. It was taken using mysql-connector-java-5.1.45 for the same database.
Created attachment 147960 [details] Actual snapshot using native MySQL connector: Tools>Relationships
Tried to test this one but when opening a database by the native MySQL-connector of LO 6.2.0.1rc all tables (of every shown database) were write protected. When opening through JDBC I could add data ...
Dan : You don't mention how you created the relations. 1) Via the mysql commqnd line or another DBMS tool ; 2) Via drag and drop using the LO relations editor 3) Via the Relations menu dialog (Add relation button). I'm assuming via the LO GUI but it would be nice to have those details fro reproducibility.
(In reply to Alex Thurgood from comment #4) > Dan : > > You don't mention how you created the relations. > > 1) Via the mysql commqnd line or another DBMS tool ; > 2) Via drag and drop using the LO relations editor > 3) Via the Relations menu dialog (Add relation button). > > I'm assuming via the LO GUI but it would be nice to have those details fro > reproducibility. The relationships were created in a new database back in 2014 or earlier using whatever LibreOffice was current at the time. I have been using this database ever since upgrading LO as new versions became available. If my memory is correct, I was still using the MySQL connector extension last spring that I had created back in 2013 to connect to MySQL. I should also mention that at the time I filed this bug, I was using MySQL 5.7. along with MySQL Workbook 8.0.13. The relationships were working in Workbook then. However, after making sure I had a connection between Workbook and Base and had saved these relationships, I opened a Base database using the native MySQL connector. That is when I saw that the relationships were wrong. I have since upgraded MySQL to version 8.0.13 and also have the MySQL(JDBC) 8.0.13 driver which I can use with LO 6.2.0.1 to access MySQL with apparently no problems. (The native MySQL connector will no longer connect to the MySQL database. A different problem, I know.)
Tamas Bunth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/74de1d0051b6dc7392ce482444c4a0ef5376260c%5E%21 tdf#122437 mysqlc: fix foreign key name query It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tamas Bunth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/ead0a04e413018f94a307a1b621e53a5f4d25a70%5E%21 tdf#122437 mysqlc: consider "types" parameter in.. It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tamas Bunth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/316f85fa1d0617064a9908dc336586332e9375ae%5E%21 tdf#122437 mysqlc: Fix foreign key references It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi Tamas Bunth, Do you think the fixes for this issue should be cherry-picked to 6-2 brach ?
(In reply to Xisco Faulí from comment #9) > Hi Tamas Bunth, > Do you think the fixes for this issue should be cherry-picked to 6-2 brach ? Yes
(In reply to Tamas Bunth from comment #10) > (In reply to Xisco Faulí from comment #9) > > Hi Tamas Bunth, > > Do you think the fixes for this issue should be cherry-picked to 6-2 brach ? > > Yes Patch in gerrit: https://gerrit.libreoffice.org/#/c/67416/
Tamas Bunth committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/06d9cd41276dc127ddccc151d620e0b34e4f57b7%5E%21 tdf#122437: Combine commits for libreoffice-6-2 It will be available in 6.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.