Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 56665 invoked from network); 28 Mar 2007 11:24:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2007 11:24:55 -0000 Received: (qmail 96046 invoked by uid 500); 28 Mar 2007 11:25:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 95999 invoked by uid 500); 28 Mar 2007 11:25:00 -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 95989 invoked by uid 99); 28 Mar 2007 11:25:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2007 04:25:00 -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; Wed, 28 Mar 2007 04:24:52 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8E0E471406C for ; Wed, 28 Mar 2007 04:24:32 -0700 (PDT) Message-ID: <32819973.1175081072579.JavaMail.jira@brutus> Date: Wed, 28 Mar 2007 04:24: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: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-1949?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484820 ]=20 Oleksandr Alesinskyy commented on DERBY-1949: --------------------------------------------- Yes, I definitely had misread the documentation. While it is not perfect I = have to admit that by really careful reading it is possible to understand w= hat is what. The misleading is usage of "search string" term. Usually, it d= esignates a string which is searched inside of other string and in current = documentation it is used in opposite sense. Concerning behavior - as soon as argument meaning is clear, behavior is per= fect and need not be changed. IJ Version 10.2 ij> connect 'd:/work/lms'; ij> values locate( '1',''); 1 ----------- 0 1 Zeile ausgew=C3=B5hlt ij> values locate('!','"'; FEHLER 42X01: Syntaxfehler: Encountered "" at line 1, column 21. ij> values locate('!','"'); 1 ----------- 0 1 Zeile ausgew=C3=B5hlt ij> values locate('',''); 1 ----------- 1 1 Zeile ausgew=C3=B5hlt ij> values locate('','',2); 1 ----------- 2 1 Zeile ausgew=C3=B5hlt ij> values locate('','',2); 1 ----------- 2 1 Zeile ausgew=C3=B5hlt ij> values locate('1',''); 1 ----------- 0 1 Zeile ausgew=C3=B5hlt ij> values locate('1','',2); 1 ----------- 0 1 Zeile ausgew=C3=B5hlt Concerning parameters order - it is the same as by DB2 and differs from SyB= ase and Oracle does not support LOCATE at all (INSTR is used instead). In m= y opinion, it is better to keep the current order. Proposed documentation change is better then current documentation but stil= l not sompletely clear. I guess, something like to=20 "First CharacterExpression is a string to search for. Sexond CharacterExpression is a string to search in. ... if first argument is an empty string then value of third argument is return= ed (or 1 if it is not specified) even if the 2nd argument is an empty strin= g. If any of arguments has null value then result is null." Regards, Oleksandr > locate function returns invalid value when first parameter is empty strin= g > -------------------------------------------------------------------------= - > > 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 > Attachments: docs.diff, rrefsqlj61998.html > > > locate function returns false invalid when first parameter is empty strin= g, > e.g.=20 > values(locate('','A') > results in 1, which is obviously wrong --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.