[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [wtp-dev] RDB components and indexes
|
Hello,
It think that this code incorrect, yet (I add in bug 91414, but bug is "fixed")
File src/org/eclipse/wst/rdb/internal/core/rte/jdbc/JDBCTable.java
line 246
...
ResultSet r = metaData.getIndexInfo(null,null,table.getName(),false,false);
Index index = null;
String indexName=""; //$NON-NLS-1$
while(r.next()) {
final String schemaName = r.getString(2);
if (schemaName != null && (! table.getSchema().getName().equals(schemaName))){
continue;
}
...
we want (probably) : all indexes for table 'table'
we get : all indexes in table's schema (table.getSchema()) for all tables (in all schemas)
with name table.getName()
Scenario :
schema1 :
schema1.table1
shema1.index1 for schema1.table1
schema1.index3 for schema2.table1
schema2 :
schema2.table1
schema2.index2 for schema2.table1
schema2.index4 for schema1.table1
1. find indexes for schema1.table1
we get : schema1.index1, schema1.index3
This is incorrect - index3 is for schema2.table1
Correct is : schema1.index1 , schema2.index3
2. find indexes for schema2.table1
we get : schema2.index2, schema2.index4
correct is : schema2.index2,schema1.index3
Correct code is :
ResultSet r = metaData.getIndexInfo(null,table.getSchema(),table.getName(),false,false);
Index index = null;
String indexName=""; //$NON-NLS-1$
while(r.next()) {
//final String schemaName = r.getString(2);
//if (schemaName != null && (! table.getSchema().getName().equals(schemaName))){
// continue;
//}
regards
On Thursday 14 April 2005 05:00 pm, snpe wrote:
> this is link https://bugs.eclipse.org/bugs/show_bug.cgi?id=91414
>
> On Thursday 14 April 2005 02:50 pm, Lawrence Mandel wrote:
> > Thanks for the contribution Haris. Please open a bug report and submit a
> > patch with your fix.
> >
> > Lawrence Mandel
> >
> > Software Developer
> > IBM Rational Software
> > Phone: 905 - 413 - 3814 Fax: 905 - 413 - 4920
> > lmandel@xxxxxxxxxx
> >
> >
> >
> > snpe <snpe@xxxxxxxxxx>
> > Sent by: wtp-dev-bounces@xxxxxxxxxxx
> > 04/14/2005 11:33 AM
> > Please respond to
> > "General discussion of project-wide or architectural issues."
> >
> >
> > To
> > wtp-dev@xxxxxxxxxxx
> > cc
> >
> > Subject
> > [wtp-dev] RDB components and indexes
> >
> >
> >
> >
> >
> >
> > Hello,
> > I find bug and fix for problem with indexes in database explorer
> > Oracle (8 and 9) retrun first row with inde_name = null and webtools
> > skip other indexes .
> > Probelm is in method :
> >
> > org.eclipse.wst.rdb.internal.core.rte.jdbc.JDBCTTable#loadIndexes(Connection
> > connection, EList indexList, Table table)
> >
> > line 246
> >
> > except
> >
> > ResultSet r =
> > metaData.getIndexInfo(null,null,table.getName(),false,false);
> >
> > this
> >
> > ResultSet r =
> > metaData.getIndexInfo(null,schema.getName(),table.getName(),false,false);
> >
> >
> > line 251
> >
> > except
> >
> > if (indName == null) break;
> >
> > this
> >
> > if (indName == null) continue;
> >
> > regards
> > Haris Peco
> > _______________________________________________
> > wtp-dev mailing list
> > wtp-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/wtp-dev
> >
> >
> _______________________________________________
> wtp-dev mailing list
> wtp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/wtp-dev
>