db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6030) Length of escape string in LIKE ... ESCAPE not properly checked with territory based collation
Date Tue, 06 Aug 2013 18:03:48 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13731027#comment-13731027
] 

ASF subversion and git services commented on DERBY-6030:
--------------------------------------------------------

Commit 1511054 from [~mamtas] in branch 'code/branches/10.8'
[ https://svn.apache.org/r1511054 ]

Backporting revision 1430735 to 10.8

Backporting DERBY-6030(Length of escape string in LIKE ... ESCAPE not properly checked with
territory based collation) to 10.8
                
> Length of escape string in LIKE ... ESCAPE not properly checked with territory based
collation
> ----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6030
>                 URL: https://issues.apache.org/jira/browse/DERBY-6030
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.9.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.10.1.1
>
>         Attachments: d6030-1a.diff
>
>
> When an ESCAPE clause contains multiple characters, but only a single collation element,
they are accepted as long as it's not a literal:
> ij> connect 'jdbc:derby:memory:nodb;create=true;territory=no;collation=TERRITORY_BASED';
> ij> create table t(x varchar(20), y varchar(20), z varchar(20));
> 0 rows inserted/updated/deleted
> ij> insert into t values ('abc', 'def', 'aa');
> 1 row inserted/updated/deleted
> ij> select * from t where x like y escape z;
> X                   |Y                   |Z                   
> --------------------------------------------------------------
> 0 rows selected
> If the same query is performed with a literal in the ESCAPE clause, the problem is detected
and correctly reported:
> ij> select * from t where x like y escape 'aa';
> ERROR 22019: Invalid escape sequence, 'aa'. The escape string must be exactly one character.
It cannot be a null or more than one character.

--
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