db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6032) Concatenation operator confuses collation
Date Wed, 19 Jun 2013 08:28:21 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dag H. Wanvik updated DERBY-6032:
---------------------------------

               Urgency: Urgent
     Affects Version/s: 10.7.1.1
                        10.8.1.2
                        10.8.2.2
                        10.8.3.0
                        10.10.1.1
    Bug behavior facts: Regression
                Labels: derby_triage10_11  (was: )

Triaged for 10.11, marking urgent since this is a regression in 1.7; 10.6 does not throw.
                
> Concatenation operator confuses collation
> -----------------------------------------
>
>                 Key: DERBY-6032
>                 URL: https://issues.apache.org/jira/browse/DERBY-6032
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.7.1.1, 10.8.1.2, 10.8.2.2, 10.8.3.0, 10.9.1.0, 10.10.1.1
>            Reporter: Knut Anders Hatlen
>              Labels: derby_triage10_11
>
> Given this table:
> ij> connect 'jdbc:derby:memory:db;territory=en;collation=TERRITORY_BASED;create=true';
> ij> create table t(x varchar(10));
> 0 rows inserted/updated/deleted
> ij> insert into t values 'a' || 'b';
> 1 row inserted/updated/deleted
> The following query works:
> ij> select * from t where x = 'ab';
> X         
> ----------
> ab        
> 1 row selected
> However, if the string is generated with the concatenation operator, an exception is
thrown:
> ij> select * from t where x = 'a' || 'b';
> ERROR 42818: Comparisons between 'VARCHAR (TERRITORY_BASED)' and 'CHAR (UCS_BASIC)' are
not supported. Types must be comparable. String types must also have matching collation. If
collation does not match, a possible solution is to cast operands to force them to the default
collation (e.g. SELECT tablename FROM sys.systables WHERE CAST(tablename AS VARCHAR(128))
= 'T1')
> I'd expect the two queries to be equivalent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message