3 messages in com.mysql.lists.javaJDBC getIndexInfo() bug or misread?
FromSent OnAttachments
George Van Treeck07 Dec 2004 09:39 
Mark Matthews07 Dec 2004 09:47 
Mark Matthews07 Dec 2004 10:31 
Subject:JDBC getIndexInfo() bug or misread?
From:George Van Treeck (geor@sbcglobal.net)
Date:12/07/2004 09:39:57 AM
List:com.mysql.lists.java

It appears that when the unique argument to getIndexInfo is set to "true", that index of column containing non-unique values is also returned. I need to be able to determine programmatically, which columns only allow unique values.

The exact method used is:

public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException

The Sun JDBC API documentation says:

unique - when true, return only indices for unique values; when false, return indices regardless of whether unique or not

Is returning an index for a column with non-unique values when unique is set to "true" the correct behaviour or a bug?

Using version 4.0.18-nt of MySQL.

-George