Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-66

Regression in DatabaseMetaData.getPrimaryKeys()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.5
    • Fix Version/s: 1.1.6
    • Component/s: None
    • Labels:
      None

      Description

      When upgrading jOOQ integration tests from MariaDB JDBC driver 1.1.2 to 1.1.5, I discovered a regression, probably introduced with CONJ-41.

      Here's how to reproduce:

      CREATE TABLE t1 (
        id1 integer,
        constraint pk primary key(id1)
      );
      CREATE TABLE t2 (
        id2a integer,
        id2b integer,
        constraint pk primary key(id2a, id2b),
        constraint fk1 foreign key(id2a) references t1(id1),
        constraint fk2 foreign key(id2b) references t1(id1)
      );

      Now, call

      connection.getMetaData().getPrimaryKeys(null, null, "t2")

      This will produce duplicate rows as can be seen here:

      +---------+-----------+----------+-----------+-------+-------+
      |TABLE_CAT|TABLE_SCHEM|TABLE_NAME|COLUMN_NAME|KEY_SEQ|PK_NAME|
      +---------+-----------+----------+-----------+-------+-------+
      |test     |{null}     |t2        |id2a       |      1|{null} |
      |test     |{null}     |t2        |id2b       |      1|{null} |    <--- bad record
      |test     |{null}     |t2        |id2b       |      2|{null} |
      +---------+-----------+----------+-----------+-------+-------+

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wlad Vladislav Vaintroub
              Reporter:
              lukas.eder Lukas Eder
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.