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 "Mamta A. Satoor (JIRA)" <ji...@apache.org> on 2007/05/18 09:27:16 UTC

[jira] Created: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
-------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-2669
                 URL: https://issues.apache.org/jira/browse/DERBY-2669
             Project: Derby
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 10.3.0.0
            Reporter: Mamta A. Satoor


If a user specifies a create database url like following
jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


Re: [jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by Laura Stewart <sc...@gmail.com>.
On 5/18/07, Mamta A. Satoor (JIRA) <ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497003 ]
>
> Mamta A. Satoor commented on DERBY-2669:
> ----------------------------------------
>
> I need to admit that I am not sure why I assumed that collation attribute with value TERRITORY_BASED and no territory attribute should translate to UCS_BASIC for user schemas.
>
> It looks like then we are doing the right thing already. And following behavior is as expected
> ij> connect 'jdbc:derby:c:/dellater/db1_52_data;create=true;collation=TERRITORY_BASED';
> ij> select tablename from sys.systables where tablename='T1';
> ERROR 42818: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
>
> I will go ahead and mark this as not an issue.

You seem to be selecting from a system table. Yet the documentation says

"The collation attribute applies only to user-defined tables. The
system tables use the Unicode codepoint collation."

Am I missing something?
-- 
Laura Stewart

[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497016 ] 

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

Laura had following comment on this issue on derby-dev

You seem to be selecting from a system table. Yet the documentation says

"The collation attribute applies only to user-defined tables. The
system tables use the Unicode codepoint collation."

Am I missing something?

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Resolved: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

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

Mike Matrigali resolved DERBY-2669.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.3.0.0

The following commit adds a test of the expected behavior to the CollationTest2 test.  

m3_ibm5:42>svn commit

Sending        java\testing\org\apache\derbyTesting\functionTests\tests\lang\CollationTest2.java
Transmitting file data .
Committed revision 542175.

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>            Assignee: Mike Matrigali
>             Fix For: 10.3.0.0
>
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496942 ] 

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

Let me start out by asking this question - when user says collatoin=TERRITORY_BASED without an explicit terriotry attribute, don't we want the collation to be UCS_BASIC for user schemas too? ie use the same collation which is UCS_BASIC for both user schemas and system schemas?

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497018 ] 

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

Laura, I selected on purpose from system table to show that system tables character columns will have collation of UCS_BASIC and the character constant 'T1' will have collation of user-schema which is TERRITORY_BASED for this db1_52 database and hence the comparison between system table character column and constant character string will fail when the comparison is done inside a user schema.

Note that character string constants pickup their collation from the current schema which in my example above is 'APP' schema which is user schema.

If the same query above is executed inside SYS schema, then the query won't fail
ij> connect 'jdbc:derby:c:/dellater/db1_52_data;create=true;collation=TERRITORY_BASED'; 
ij> set schema SYS;
0 rows selected
ij> select tablename from sys.systables where tablename='T1'; 
TABLENAME
---------------------------------------------------------------
0 rows selected

In the case above, character string constant 'T1' picked up the collation of SYS schema and hence the comparison did not fail.


> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497734 ] 

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

Derby is behaving as expected when JDBC url has no territory attribute but it has collation attibute with value as terriotry based. But before we close this Jira entry, we should add a test case for this.

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497003 ] 

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

I need to admit that I am not sure why I assumed that collation attribute with value TERRITORY_BASED and no territory attribute should translate to UCS_BASIC for user schemas. 

It looks like then we are doing the right thing already. And following behavior is as expected
ij> connect 'jdbc:derby:c:/dellater/db1_52_data;create=true;collation=TERRITORY_BASED'; 
ij> select tablename from sys.systables where tablename='T1'; 
ERROR 42818: Comparisons between 'VARCHAR' and 'CHAR' are not supported. 

I will go ahead and mark this as not an issue.

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496991 ] 

Daniel John Debrunner commented on DERBY-2669:
----------------------------------------------

> Let me start out by asking this question - when user says collatoin=TERRITORY_BASED without an explicit terriotry attribute, don't we want the collation to be UCS_BASIC for user schemas too? ie use the same collation which is UCS_BASIC for both user schemas and system schemas?

Why? The user asked for TERRITORY_BASED collation and the database has a territory.


> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496990 ] 

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

Just want to record the current Derby 10.3 behavior for a database where collation=TERRITORY_BASED and no territory is specified

ij> connect 'jdbc:derby:c:/dellater/db1_52_data;create=true;collation=TERRITORY_BASED';
ij> select tablename from sys.systables where tablename='T1';
ERROR 42818: Comparisons between 'VARCHAR' and 'CHAR' are not supported.

This does not seem correct. I think although user has asked for TERRITORY_BASE collation, since no territory attribute is specified, internally, we should be using UCS_BASIC for both system and user schemas.

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Updated: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

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

Mike Matrigali updated DERBY-2669:
----------------------------------

    Assignee: Mike Matrigali

The decision on this issue is to implement the following (which is not the short or long description)

If a user specifies a create database url like following
jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
then a territory based collation database will be created using whatever the current territory of the JVM is. 


> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>            Assignee: Mike Matrigali
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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


[jira] Commented: (DERBY-2669) If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496884 ] 

Daniel John Debrunner commented on DERBY-2669:
----------------------------------------------

-1
A database always has a territory, when not explictly specified at create time it defaults to the locale of the JVM.

> If no territory attribute is not specified at create database time, then we should ignore the collation attribute if specified.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2669
>                 URL: https://issues.apache.org/jira/browse/DERBY-2669
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>
> If a user specifies a create database url like following
> jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED
> we should ignore the collation attribute because no territory attribute has been specified. The current Derby 10.3 code does not do that. Once this is fixed, we should add a test case for it in CollationTest.java

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