Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 29997E001 for ; Wed, 9 Jan 2013 12:36:14 +0000 (UTC) Received: (qmail 69640 invoked by uid 500); 9 Jan 2013 12:36:13 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 69572 invoked by uid 500); 9 Jan 2013 12:36:13 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 69376 invoked by uid 99); 9 Jan 2013 12:36:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 12:36:13 +0000 Date: Wed, 9 Jan 2013 12:36:13 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6030) Length of escape string in LIKE ... ESCAPE not properly checked with territory based collation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-6030: -------------------------------------- Issue & fix info: Patch Available,Repro attached (was: Repro attached) > 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: Knut Anders Hatlen > 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