Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.5
-
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
- relates to
-
CONJ-41 connection.getMetaData().getPrimaryKeys() returns wrong ordinal_colum when primary key is not in the first colum.
- Closed