Driver version
13.2.0.jre11
SQL Server version
Microsoft SQL Server 2017 (RTM-CU31-GDR) (KB5058714) - 14.0.3495.9 (X64) Jun 10 2025 16:22:03
Problem description
According to the docs, sp_statistics contains NON_UNIQUE with 1 = not unique and 0 = unique.
But sys.indexes contains is_unique with 1 = unique and 0 = not unique.
DatabaseMetaData.getIndexInfo() simply merges the results of both result without handling this difference.
This e.g. causes hibernate-tools to fail on reverse engineering the database model to entity classes, as the same index name may be unique and non-unique at the same time.