Bug #109803 DatabaseMetaData#getIndexInfo should be properly ordered
Submitted: 27 Jan 2023 3:10 Modified: 7 Feb 2023 11:03
Reporter: Jin Kwon Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.32 OS:Other
Assigned to: CPU Architecture:Any
Tags: DatabaseMetaData

[27 Jan 2023 3:10] Jin Kwon
Description:
DatabaseMetaData#getIndexInfo should return a result ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.

I see the following result.

IndexInfo(
    nonUnique=false,
    type=3,
    indexName=local_code_UNIQUE,
    ordinalPosition=1,
)

IndexInfo(
    nonUnique=false,
    type=3,
    indexName=PRIMARY,
    ordinalPosition=1,
)

How to repeat:
Invoke and see.

Suggested fix:
Should be order as specified.
[27 Jan 2023 8:15] MySQL Verification Team
Hello Jin Kwon,

Thank you for the report and feedback.

regards,
Umesh
[7 Feb 2023 11:03] Filipe Silva
There's nothing wrong with the ordering. Is it because of the case of the index names? If so then mind that many MySQL identifiers are case insensitive, indexes included, and thus the ordering is case insensitive here too:

> Partition, subpartition, column, index, stored routine, event, and resource group names are not case-sensitive on any platform, nor are column aliases.
(https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html)
[7 Feb 2023 11:04] Filipe Silva
BTW, this is a duplicate of Bug#68098.