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 "Myrna van Lunteren (JIRA)" <ji...@apache.org> on 2007/11/07 02:39:50 UTC

[jira] Created: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
---------------------------------------------------------------------------------------------------

                 Key: DERBY-3182
                 URL: https://issues.apache.org/jira/browse/DERBY-3182
             Project: Derby
          Issue Type: Bug
    Affects Versions: 10.3.1.4, 10.2.2.0, 10.2.1.6, 10.1.3.1, 10.1.2.1, 10.1.1.0, 10.0.2.1, 10.0.2.0
            Reporter: Myrna van Lunteren


The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.

Thus, in the following situation:
        s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
        s.execute("insert into a values (1,1,1)");  
        DatabaseMetaData dmd = conn.getMetaData(); 

The call:
            ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
gives the same results(columns i & j) as
            ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);

This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
The text in bestrowidentifier was:
-- REMIND: we aren't handling nullOk flag correctly
-- we just drop nullable cols, we should skip an answer
-- that has nullable cols in it instead and look for another one.
create table t13 (i int not null, j int not null, k int, unique (i,j));

-- result: columns i, j (WRONG) 
-- the correct answer is k: the non-null columns of the table
execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-3182:
--------------------------------------

    Attachment: repro.java

> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren closed DERBY-3182.
-------------------------------------


> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>            Assignee: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren reassigned DERBY-3182:
-----------------------------------------

    Assignee: Myrna van Lunteren

> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>            Assignee: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541390 ] 

Myrna van Lunteren commented on DERBY-3182:
-------------------------------------------

Interesting.
I looked at what I could find for this test in the old Cloudscape version control system, and the oldest I found, dating from early 1999, was a little different, but still does not specify k as unique. This is from the .out:
:----------------------------------------:
ij> -- REMIND: we aren't handling nullOk flag correctly
-- we just drop nullable cols, we should skip an answer
-- that has nullable cols in it instead and look for another one.
create table t13 (i int, j int not null, k int, unique (i,j));
0 rows inserted/updated/deleted
ij> -- result: columns j (WRONG) 
-- the correct answer is i, k: the non-null columns of the table
values (class COM.cloudscape.internalUtil.DatabaseMetaDataUtil).getBestRowIdentifier(
getCurrentConnection(),'','APP','T13',0,false);
SQLCol1        
---------------
ResultSet #0   

++++++++++++++++
+ResultSet #0 +
++++++++++++++++
SCOPE          |COLUMN_NAME                                                                                                                     |DATA_TYPE      |TYPE_NAME                                                                                                                       |COLUMN_SIZE    |BUFFER_LENGTH  |DECIMAL_DIGITS |PSEUDO_COLUMN  
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2              |J          
:----------------------------------------:


> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541329 ] 

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

I think the comment which says that the correct answer is k, is wrong. Since the column k is not declared as unique, it does not uniquely identify a row. Derby doesn't support the unique constraint on a nullable column, but it did at some point (although the implementation was not SQL compliant and therefore was disabled). Could it be that this test was written before unique on nullable columns was disabled, and it used to declared k as a unique column? Possibly, the test was updated but the comment wasn't.

> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren resolved DERBY-3182.
---------------------------------------

    Resolution: Invalid

I've marked this as invalid, and a test issue.
I adjusted the test comments, and modified the test case to verify that the result changes if the parameter is changed on a simple table like this:
st.execute("create table brit13 (i int not null, j int)");

and the test cases now are:
// result: column i, should've ignored null column
rs = dmd.getBestRowIdentifier(null,"APP","BRIT13",0,false);
[...verifyresults...]
// result: columns i, j
rs = dmd.getBestRowIdentifier(null,"APP","BRIT13",0,true);
[...verifyresults...]



> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3182) fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....) has no effect

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-3182:
--------------------------------------

    Component/s: Test

> fifth parameter (boolean isNullable) in DatabaseMetaData.getBestRowIdentifier(.....)  has no effect
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3182
>                 URL: https://issues.apache.org/jira/browse/DERBY-3182
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Myrna van Lunteren
>         Attachments: repro.java
>
>
> The fifth parameter in a call to DatabaseMetaData.getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) is getting ignored.
> Thus, in the following situation:
>         s.execute("create table a (i int not null, j int not null, k int, unique (i,j))");
>         s.execute("insert into a values (1,1,1)");  
>         DatabaseMetaData dmd = conn.getMetaData(); 
> The call:
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,true);
> gives the same results(columns i & j) as
>             ResultSet rs = dmd.getBestRowIdentifier(null,"APP","A",0,false);
> This has been documented as incorrect in the test bestrowidentifier.sql but I could not find any bug logged.
> The text in bestrowidentifier was:
> -- REMIND: we aren't handling nullOk flag correctly
> -- we just drop nullable cols, we should skip an answer
> -- that has nullable cols in it instead and look for another one.
> create table t13 (i int not null, j int not null, k int, unique (i,j));
> -- result: columns i, j (WRONG) 
> -- the correct answer is k: the non-null columns of the table
> execute bestrow using 'values(''APP'',''T13'',0,''false'')';

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.