Bug #43991 GetSchema on Indexes or IndexColumns fails where index or column names are restr
Submitted: 31 Mar 2009 19:21 Modified: 6 Apr 2009 15:17
Reporter: Tonci Grgin
Status: Closed
Category:Connector/Net Severity:S2 (Serious)
Version: OS:Any
Assigned to: Reggie Burnett Target Version:

[31 Mar 2009 19:21] Tonci Grgin
Description:
In SchemaProvider.cs, methods GetIndexes and GetIndexColumns pass their restrictions
directly to GetTables. This only works if the restrictions are no more specific that
schemaName and tableName. If IndexName is given, this is passed to GetTables where it is
treated as TableType, so no tables are returned (unless your index name happens to be
"BASE TABLE" or "VIEW"). This means that both methods return no rows.

How to repeat:
Compare above methods with method GetColumns in the same source file.
[31 Mar 2009 21:38] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/70954
[31 Mar 2009 21:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/70955
[31 Mar 2009 21:40] Reggie Burnett
fixed in 5.1.8, 5.2.6+
[6 Apr 2009 15:17] Tony Bedford
An entry was added to the 5.1.8 and 5.2.6 changelogs:

Calling GetSchema() on Indexes or IndexColumns failed where index or column names were
restricted.

In SchemaProvider.cs, methods GetIndexes() and GetIndexColumns() passed their
restrictions directly to GetTables(). This only worked if the restrictions were no more
specific than schemaName and tableName. If IndexName was given, this was passed to
GetTables() where it was treated as TableType. As a result no tables were returned,
unless the index name happened to be BASE TABLE or VIEW. This meant that both methods
failed to return any rows.