microsoft/mssql-jdbc

DatabaseMetaData#getProcedures not ordered as specified.

onacit opened this issue · 2 comments

Driver version

12.6.0.jre11

SQL Server version

Maven home: /opt/homebrew/Cellar/maven/3.9.6/libexec
Java version: 21.0.2, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
Default locale: en_KR, platform encoding: UTF-8
OS name: "mac os x", version: "14.3", arch: "aarch64", family: "mac"

Client Operating System

Maven home: /opt/homebrew/Cellar/maven/3.9.6/libexec
Java version: 21.0.2, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
Default locale: en_KR, platform encoding: UTF-8
OS name: "mac os x", version: "14.3", arch: "aarch64", family: "mac"

JAVA/JVM version

Table schema

?

Problem description

getProcedures's result should be ordered as specified yet I got,

group is not sorted according to Comparator$$Lambda/0x00000008000fe3d0 comparator because element 202:
  Procedure(super=AbstractMetadataType(super=com.github.jinahya.database.metadata.bind.Procedure@bd5520b1, unmappedValues={NUM_INPUT_PARAMS=-1, NUM_OUTPUT_PARAMS=-1, NUM_RESULT_SETS=-1}),
    procedureCat=master,
    procedureSchem=sys,
    procedureName=sp_assemblies_rowset_rmt;1,
    remarks=null,
    procedureType=2,
    specificName=null)
is not less or equal than element 203:
  Procedure(super=AbstractMetadataType(super=com.github.jinahya.database.metadata.bind.Procedure@bd5520b1, unmappedValues={NUM_INPUT_PARAMS=-1, NUM_OUTPUT_PARAMS=-1, NUM_RESULT_SETS=-1}),
    procedureCat=master,
    procedureSchem=sys,
    procedureName=sp_assemblies_rowset2;1,
    remarks=null, procedureType=2,
    specificName=null)

Expected behavior

Actual behavior

Error message/stack trace

Any other details that can be helpful

JDBC trace logs

It's not clear at the moment how much can be done from the driver's side. We'll look into this and see a) can the ordering be done from the JDBC side, and b) the potential impact of changing how we order. We'll update this issue when we have more information.

This will be added to our backlog. Putting aside whether this is possible (still unclear), a change would involve an extra, substantial, performance impact, and we're still not sure what the downstream effect of changing the order from what SQL server gives us is. We'll revisit this during a later triage.