Bug #109808 DatabaseMetaData#getPrimaryKeys should ordered by COLUMN_NAME
Submitted: 27 Jan 2023 5:20 Modified: 24 Mar 2023 21:04
Reporter: Jin Kwon Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.32 OS:Any
Assigned to: CPU Architecture:Any
Tags: DatabaseMetaData, getPrimaryKeys

[27 Jan 2023 5:20] Jin Kwon
Description:
DatabaseMetaData#getPrimaryKeys should be ordered by COLUMN_NAME.

I see the following order.

PrimaryKey(
    tableCat=performance_schema,
    tableSchem=null,
    tableName=session_account_connect_attrs,
    columnName=PROCESSLIST_ID,
    keySeq=1,
    pkName=PRIMARY
)

PrimaryKey(
    tableCat=performance_schema,
    tableSchem=null,
    tableName=session_account_connect_attrs,
    columnName=ATTR_NAME,
    keySeq=2,
    pkName=PRIMARY
)

How to repeat:
Invoke and see.
[27 Jan 2023 8:13] MySQL Verification Team
Hello Jin Kwon,

Thank you for the report and feedback.

regards,
Umesh
[18 Mar 2023 2:53] Jin Kwon
Here comes another results.

PrimaryKey(
    super=com.github.jinahya.database.metadata.bind.PrimaryKey@3a1238cc{
        unmappedValues=null
    },
    tableCat=performance_schema,
    tableSchem=null,
    tableName=session_account_connect_attrs,
    columnName=PROCESSLIST_ID,
    keySeq=1,
    pkName=PRIMARY
)
PrimaryKey(
    super=com.github.jinahya.database.metadata.bind.PrimaryKey@c19799b8{
        unmappedValues=null
    },
    tableCat=performance_schema,
    tableSchem=null,
    tableName=session_account_connect_attrs,
    columnName=ATTR_NAME,
    keySeq=2,
    pkName=PRIMARY
)
[24 Mar 2023 21:04] Daniel So
Posted by developer:
 
Added the following entry to the C/J 8.0.33 changelog: 

"Results returned by the getPrimaryKeys method of the DatabaseMetadata interface were not sorted by COLUMN_NAME as required by the JDBC specification."