[CONJ-471] PK_NAME returned by DatabaseMetadata.getPrimaryKeys() should not be null Created: 2017-05-15  Updated: 2017-05-31  Resolved: 2017-05-31

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC 4.2 compatibility, metadata
Affects Version/s: 1.5.8, 1.5.9
Fix Version/s: 1.6.1, 2.0.2

Type: Bug Priority: Major
Reporter: QING ZHU Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

For MariaDB, driver version ="1.5.8" and "1.5.9",
Maria DB server version: MariaDB 10.2.4 RC
OS: windows 10



 Description   

PK_NAME returned in DatabaseMetadata.getPrimaryKeys() should not be null

For MariaDB, driver version ="1.5.8" and "1.5.9",
Maria DB server version: MariaDB 10.2.4 RC

DatabaseMetadata.getPrimaryKeys() returns PK_NAME as null, which is incorrect.

https://mariadb.com/kb/en/mariadb/create-table/, please note that constraint names cannot be defined by the user.

This bug breaks IBM Cognos' mutual customers to generate relationship based on primary keys and foreign keys.



 Comments   
Comment by Diego Dupin [ 2017-05-16 ]

Hi zhuq.
Right, PK_NAME must always return INDEX_NAME values (that is always set to 'PRIMARY').

Comment by QING ZHU [ 2017-05-31 ]

Hi diego dupin, I see this issue has been fixed in JDBC version 1.6.1 and 2.0.2. Is that correct? If so, where to download the fixed JDBC drivers? Thanks.

Comment by Diego Dupin [ 2017-05-31 ]

They will be released in a few days,

Snapshot are available though :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>2.0.2-SNAPSHOT</version>
    </dependency>
</dependencies>

Generated at Thu Feb 08 03:15:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.