[CONJ-1019] DatabaseMetaData.getImportedKeys should return real value for PK_NAME column Created: 2022-10-25 Updated: 2022-11-03 Resolved: 2022-11-03 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | metadata |
| Affects Version/s: | 2.6.0 |
| Fix Version/s: | 2.7.7, 3.0.9, 3.1.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Peer Törngren | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | metadata | ||
| Issue Links: |
|
||||||||
| Description |
|
For consistency with the change made in CONJ-764 and since primary keys are named PRIMARY (see MariaDbDatabaseMetaData.getPrimaryKeys), DatabaseMetaData.getImportedKeys should return PRIMARY (instead of "null") for PK_NAME column. With the change made for the PK column in exported keys, it is no longer possible to match an exported key from one table with the imported key in the related table. |
| Comments |
| Comment by Diego Dupin [ 2022-10-31 ] |
|
Currently, there is 2 differents implementations :
SHOW CREATE TABLE is way faster (benchmark on my computer show 20x faster) than using INFORMATION_SCHEMA but with the issue of having PK_NAME null. Actually I_S tables request is only done when catalog is not set (required for SHOW CREATE TABLE) I agree that current implementation is not consistent, and must be corrected. |