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

Regression in DatabaseMetaData.getPrimaryKeys()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.5
    • 1.1.6
    • None
    • 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

              wlad Vladislav Vaintroub
              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.