[CONJ-483] Wrong content of DEFERRABILITY column in MariaDbDatabaseMetaData Created: 2017-05-31  Updated: 2017-06-01  Resolved: 2017-06-01

Status: Closed
Project: MariaDB Connector/J
Component/s: metadata
Affects Version/s: 2.0.1
Fix Version/s: 1.6.1, 2.0.2

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

Windows x64, JDK 1.8.121



 Description   

According to https://github.com/MariaDB/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java , when querying for database Metadata in getExportedKeys(), getImportedKeys() and getCrossReference(), the driver always returns the constant value 6 (=importedKeyInitiallyImmediate). This implies that the constraint can actually be set into a deferred state (=checking at the end of the transaction, NOT disabling constraint checking altogether). AFAIK deferred constraints is a capability that MariaDB does not currently implements. This creates confusion in my application (and, consequently, an SQL syntax error when trying to put the constraint in a deferred state).

Please change this value to the (IMHO) correct value of 7 (importedKeyNotDeferrable) so applications who rely on this information can behave correctly.



 Comments   
Comment by Andreas Buschka [ 2017-06-01 ]

Wow, that was a lot faster than I expected. Thank you very much!

Comment by Diego Dupin [ 2017-06-01 ]

Version will be released in a few days.
meanwhile correction is available using SNAPSHOT :

<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:16:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.