You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Deepa Remesh (JIRA)" <de...@db.apache.org> on 2005/10/27 18:18:57 UTC

[jira] Created: (DERBY-655) getImportedKeys returns duplicate rows in some cases

getImportedKeys returns duplicate rows in some cases
----------------------------------------------------

         Key: DERBY-655
         URL: http://issues.apache.org/jira/browse/DERBY-655
     Project: Derby
        Type: Bug
  Components: SQL  
    Versions: 10.2.0.0    
 Environment: Sun JDK 1.4.2, Windows XP
    Reporter: Deepa Remesh
    Priority: Minor


I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12413392 ] 

Satheesh Bandaram commented on DERBY-655:
-----------------------------------------

Submitted this patch. Normally would have asked if you really have an itch to see this fix in 10.0, but since this problem potentially leaves system tables in confusing state, I have merged this into 10.0.

Sending        java\engine\org\apache\derby\impl\sql\execute\CreateIndexConstantAction.java
Sending        java\testing\org\apache\derbyTesting\functionTests\master\DerbyNet\metadata.out
Sending        java\testing\org\apache\derbyTesting\functionTests\master\metadata.out
Sending        java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\metadata.java
Transmitting file data ....
Committed revision 409580.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Attachment: Derby655GetImportedKeysPatch1.txt
                Derby655GetImportedKeysStat1.txt

Attaching patch for the first part of the solution, which is to generate unique logical conglomerates for duplicate indexes. Also, I tried my patch against DERBY-1343 and this patch takes care of part 1 of that bug too. 
Derby655GetImportedKeysPatch1.txt is the actual patch and Derby655GetImportedKeysStat1.txt is svn stat output for the patch.

This patch is for 10.0 codeline. Same fix needs to be put in to all the subsequent codelines. Do I need to submit separate patches for 10.1 and 10.2 codelines? Can a commiter see if the patch looks good and can be checked in?

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Deepa Remesh updated DERBY-655:
-------------------------------

    Attachment: keys.java
                bigdb.sql
                smalldb.sql

Attaching a repro for this. To see the problem:

1. Start ij and run bigdb.sql and smalldb.sql. It will create 2 databases bigdb and smalldb. Since it takes a while to run the sql, I will also attach a zip file with the databases already created. 
2. Run "java keys smalldb". Call to getImportedKeys for the table 'ACCCMDGRP' returns 2 rows, which is correct.
3. Run "java keys bigdb". Call to getImportedKeys for the table 'ACCCMDGRP' returns 3 rows instead of 2. In the output, rows 2 and 3 are duplicates.


> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Priority: Minor
>  Attachments: bigdb.sql, keys.java, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12414987 ] 

Mamta A. Satoor commented on DERBY-655:
---------------------------------------

The patch I submitted couple minutes back (Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt) is for the main codeline. 

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Structure of Derby (OO Design)

Posted by Hayden Melton <hm...@ec.auckland.ac.nz>.
Hi all,

I am a PhD student at the University of Auckland, New Zealand. As part of my
research I have performed an empirical study on a large corpus of open-source
Java software. Several of the applications in the corpus (Derby, Ant, Tomcat,
JMeter, POI) are from the Apache Software Foundation. If you are a developer of
Derby you might be interested to know that there are 422 source files all
involved in a big dependency cycle (or to use the graph theory term: strongly
connected component). Though it is just one dimension of design quality, it is
thought long dependency cycles among source files inhibit understanding,
testing and reuse.

In any case, a comparison of Derby to all the other applications in the corpus
is available on my webpage, along with a more detailed description of the study
and why cycles are bad:

http://www.cs.auckland.ac.nz/~hayden/corpus.htm

/
Hayden Melton


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12414558 ] 

Satheesh Bandaram commented on DERBY-655:
-----------------------------------------

This patch is committed to trunk and 10.1. Please RESOLVE and close accordingly.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12413394 ] 

Satheesh Bandaram commented on DERBY-655:
-----------------------------------------

I tried merging this fix to 10.1 branch, but there are conflicts with test changes. Can you submit a merged patch for both 10.1 and trunk?

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Attachment: Derby655GetImportedKeysPatch2Codeline101.txt

After submitting my earlier patch for 10.1, I ran the derbyall and found that there are few more masters that are getting impacted by changes to metadata_test.java. So, I am attaching a new diff file for 10.1 codeline, named Derby655GetImportedKeysPatch2Codeline101.txt(Commiters, please disregard Derby655GetImportedKeysPatch1Codeline101.txt) 

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12415097 ] 

Knut Anders Hatlen commented on DERBY-655:
------------------------------------------

Thanks Mamta! Committed revision 412320.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Deepa Remesh updated DERBY-655:
-------------------------------

    Attachment: keys_test.zip

Attaching a zip file with the databases

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Priority: Minor
>  Attachments: bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12414920 ] 

Knut Anders Hatlen commented on DERBY-655:
------------------------------------------

Mamta A. Satoor wrote:

> The upgrade test Upgrade_10_1_10_2 is not included in this patch
> because the patch submitted for 10.1 first needs to go in and then
> the upgrade test will give the correct master diff. Without the 10.1
> patch in, the 10.1 database is getting created with duplicate
> logical conglomerateids and hence, after the upgrade to 10.2, the
> database still contains duplicate rows and hence incorrect
> results. Once the patch for 10.1 goes in, the newly created 10.1 db
> will not have duplicate logical conglomerateids.

Does this mean that the upgrade test is going to fail until 10.1.3 is
released and the jars checked into the repository? If that's the case,
I think we should update the upgrade test canon temporarily now and
revert it once 10.1.3 is out. Ole's tinderbox test has failed since
the check-in of this patch.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]
     
Deepa Remesh closed DERBY-655:
------------------------------


> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>      Fix For: 10.2.0.0
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Resolved: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by Mamta Satoor <ms...@gmail.com>.
Mike,

At this point, it is only identified that upgrade needs to do some work to
fix duplicate conglomerateids but no details have been discussed as to how
to address it.

Mamta


On 6/30/06, Mike Matrigali <mi...@sbcglobal.net> wrote:
>
>
>
> Mamta A. Satoor (JIRA) wrote:
> >      [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]
> >
> > Mamta A. Satoor resolved DERBY-655:
> > -----------------------------------
> >
> >     Fix Version: 10.2.0.0
> >      Resolution: Fixed
> >
> > Resolving this issue since the patch ensures the uniqueness of
> conglomerateid for new conglomerates in SYSCONGLOMERATES table. For existing
> duplicate conglomeratid, work needs to be done at the database upgrade time.
> DERBY-1343 is open to track upgrade work. As per my knowledge, nobody is
> working on DERBY-1343 at this point.
> >
>
> I missed the original discussion of this issue, I know there are some
> pointers in the bug description.  After that discussion was there a
> consensus on how to address the upgrade issue?
>
>

Re: [jira] Resolved: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by Mike Matrigali <mi...@sbcglobal.net>.

Mamta A. Satoor (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]
>      
> Mamta A. Satoor resolved DERBY-655:
> -----------------------------------
> 
>     Fix Version: 10.2.0.0
>      Resolution: Fixed
> 
> Resolving this issue since the patch ensures the uniqueness of conglomerateid for new conglomerates in SYSCONGLOMERATES table. For existing duplicate conglomeratid, work needs to be done at the database upgrade time. DERBY-1343 is open to track upgrade work. As per my knowledge, nobody is working on DERBY-1343 at this point.
> 

I missed the original discussion of this issue, I know there are some 
pointers in the bug description.  After that discussion was there a 
consensus on how to address the upgrade issue?


[jira] Resolved: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]
     
Mamta A. Satoor resolved DERBY-655:
-----------------------------------

    Fix Version: 10.2.0.0
     Resolution: Fixed

Resolving this issue since the patch ensures the uniqueness of conglomerateid for new conglomerates in SYSCONGLOMERATES table. For existing duplicate conglomeratid, work needs to be done at the database upgrade time. DERBY-1343 is open to track upgrade work. As per my knowledge, nobody is working on DERBY-1343 at this point.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>      Fix For: 10.2.0.0
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-655?page=comments#action_12412003 ] 

Mamta A. Satoor commented on DERBY-655:
---------------------------------------

I was able to reduce the test case provided to following set of sql which will reproduce the erroneous behavior in Derby 10.0.
CREATE TABLE t1(c11_ID BIGINT NOT NULL);
CREATE TABLE t2 (c21_ID BIGINT NOT NULL primary key);
ALTER TABLE t1 ADD CONSTRAINT F_12 Foreign Key (c11_ID)
   REFERENCES t2 (c21_ID) ON DELETE CASCADE ON UPDATE NO ACTION;
CREATE TABLE t3(c31_ID BIGINT NOT NULL primary key);
ALTER TABLE t2 ADD CONSTRAINT F_443 Foreign Key (c21_ID)
   REFERENCES t3(c31_ID) ON DELETE CASCADE ON UPDATE NO ACTION;

If DatabaseMetaData.getImportedKeys  is run against table t1, Derby 10.0 will run 2 rows and Cloudscape 5.2 will run 1 row. 

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Attachment: Derby655GetImportedKeysPatch1CodelineTrunk.txt

I have attached the patch for the main codeline to this JIRA entry as Derby655GetImportedKeysPatch1CodelineTrunk.txt. 
The upgrade test Upgrade_10_1_10_2 is not included in this patch because the patch submitted for 10.1 first needs to go in and then the upgrade test will give the correct master diff. Without the 10.1 patch in, the 10.1 database is getting created with duplicate logical conglomerateids and hence, after the upgrade to 10.2, the database still contains duplicate rows and hence incorrect results. Once the patch for 10.1 goes in, the newly created 10.1 db will not have duplicate logical conglomerateids. The part 2 of the solution for this JIRA entry is not yet worked on. The part 2 is supposed to take care of duplicate logical conglomerate ids when a database is upgraded. 

Note to the committers : there are patches that need to be committed, one for 10.1 codeline and another for main codeline.

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Attachment: Derby655GetImportedKeysPatch1Codeline101.txt

I tried doing merge on 10.1 codeline using following 
svn merge -r 409579:409580 https://svn.apache.org/repos/asf/db/derby/code/branches/10.0
and ran into problems with test file and master files changes. merge didn't work for test file changes because in 10.1, we have split metadata.java into 2 classes, metadata.java and metadata_test.java. The changes I made in 10.0 metadata.java need to go in 10.1 metadata_test.java. I fixed this by reverting the test file and master files from the merge command and hand-doiing the test changes. The diff for 10.1 is attached as Derby655GetImportedKeysPatch1Codeline101.txt to this JIRA entry. Let me know if a commiter runs into a problem. Next, I will work on getting a patch ready for main codeline. 

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Assign To: Mamta A. Satoor
     Priority: Major  (was: Minor)

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-655) getImportedKeys returns duplicate rows in some cases

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-655?page=all ]

Mamta A. Satoor updated DERBY-655:
----------------------------------

    Attachment: Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt

The part I of the fix has gone into all the 3 codelines but the upgrade test fails with duplicate row because the 10.1 jar used by the upgrade test does not yet have those changes. 

Seems like the 10.1 jar will get updated only when 10.1.3 wil be ready and hence I am attaching a patch (Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt) with the duplicate row for the upgrade test until 10.1.3 jars are checked in. Can a committer please check in this change?

> getImportedKeys returns duplicate rows in some cases
> ----------------------------------------------------
>
>          Key: DERBY-655
>          URL: http://issues.apache.org/jira/browse/DERBY-655
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.2.0.0
>  Environment: Sun JDK 1.4.2, Windows XP
>     Reporter: Deepa Remesh
>     Assignee: Mamta A. Satoor
>  Attachments: Derby655GetImportedKeysPatch1.txt, Derby655GetImportedKeysPatch1Codeline101.txt, Derby655GetImportedKeysPatch1CodelineTrunk.txt, Derby655GetImportedKeysPatch1CodelineTrunkUpgradeTest.txt, Derby655GetImportedKeysPatch2Codeline101.txt, Derby655GetImportedKeysStat1.txt, bigdb.sql, keys.java, keys_test.zip, smalldb.sql
>
> I have a database with a large number of tables.  I get duplicate rows when I call DatabaseMetaData.getImportedKeys for a particular table. However, if I create the same table with same number of foreign keys in another database (which has fewer number of tables), then getImportedKeys returns me the correct number of rows. This error seems to happen only when the database has a large number of tables. I will attach a repro for this shortly. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira