<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - creating foreign key creates a relationship to the foreign key itself"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=122437">122437</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>creating foreign key creates a relationship to the foreign key itself
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.2.0.1 rc
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Base
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>elderdanlewis@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=147959" name="attach_147959" title="It's the relationship created by the native MySQL connector">attachment 147959</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=147959&action=edit" title="It's the relationship created by the native MySQL connector">[details]</a></span>
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."</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>