Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 51870 invoked from network); 27 Mar 2007 18:55:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 18:55:57 -0000 Received: (qmail 87591 invoked by uid 500); 27 Mar 2007 18:56:04 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 87377 invoked by uid 500); 27 Mar 2007 18:56:02 -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 87368 invoked by uid 99); 27 Mar 2007 18:56:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 11:56:02 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 11:55:52 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C15C771406C for ; Tue, 27 Mar 2007 11:55:32 -0700 (PDT) Message-ID: <4464339.1175021732789.JavaMail.jira@brutus> Date: Tue, 27 Mar 2007 11:55:32 -0700 (PDT) From: "Oleksandr Alesinskyy (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1949) locate function returns invalid value when first parameter is empty string In-Reply-To: <13022023.1160476219664.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484543 ] Oleksandr Alesinskyy commented on DERBY-1949: --------------------------------------------- It seems obvious (to me :) ) that returned value shall be 0. Derby documentation on LOCATE clearly states "If the substring is not found, LOCATE returns 0". And there is no chance to find non-empty substring in the empty string . More subtle case is when both string and substring are empty. But even in this case 0 seems to be right value (and consistent with other DBMS as far as I know, save the Oracle that agains the SQL standard treats empty strings as nulls ). Regards, Oleksandr > locate function returns invalid value when first parameter is empty string > -------------------------------------------------------------------------- > > Key: DERBY-1949 > URL: https://issues.apache.org/jira/browse/DERBY-1949 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.1.3.1, 10.2.1.6 > Environment: N/A > Reporter: Oleksandr Alesinskyy > Assigned To: Bryan Pendleton > > locate function returns false invalid when first parameter is empty string, > e.g. > values(locate('','A') > results in 1, which is obviously wrong -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.