Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CONJ-764] DatabaseMetaData.getExportedKeys return "PRIMARY" for PK_N…
…AME column (was null)
  • Loading branch information
rusher committed Mar 4, 2020
1 parent 97cead8 commit d2e0430
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -924,7 +924,7 @@ public ResultSet getExportedKeys(String catalog, String schema, String table)
+ " WHEN 'SET DEFAULT' THEN 4"
+ " END DELETE_RULE,"
+ " RC.CONSTRAINT_NAME FK_NAME,"
+ " NULL PK_NAME,"
+ " 'PRIMARY' PK_NAME,"
+ importedKeyNotDeferrable
+ " DEFERRABILITY"
+ " FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU"
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/mariadb/jdbc/DatabaseMetadataTest.java
Expand Up @@ -315,6 +315,7 @@ public void exportedKeysTest() throws SQLException {
assertEquals("id", rs.getString("pkcolumn_name"));
assertEquals("fore_key" + counter, rs.getString("fktable_name"));
assertEquals("id_ref" + counter, rs.getString("fkcolumn_name"));
assertEquals("PRIMARY", rs.getString("PK_NAME"));
counter++;
}
assertEquals(2, counter);
Expand Down

0 comments on commit d2e0430

Please sign in to comment.