Open markallanson opened 2 days ago
The code you pointed at should return NULL when AM_NAME is not 'btree' and YugabyteDB tables are 'lsm' Can you check the index definition for the one that returns bad index info
select distinct am.amname AS AM_NAME , pg_get_indexdef(i.indexrelid)
FROM pg_catalog.pg_class ct
JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid)
JOIN pg_catalog.pg_index i ON (ct.oid = i.indrelid)
JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid)
JOIN pg_catalog.pg_am am ON (ci.relam = am.oid)
where ci.relname like '%%'
;
Jira Link: DB-12045
Description
JDBC API states that getIndexInfo should return
null
as the sort order when a column does not contribute to sort.For columns that are hashed in indexes, the Yugabyte PGJDBC driver incorrectly returns
A
- Ascending order, instead of setting the value tonull
.The code in question that is the source of this bug is: https://github.com/yugabyte/pgjdbc/blob/d04fc3c064be3b69969b3cb5f72ee59e9c5d2279/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L2558
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information