Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 48436 invoked from network); 7 Nov 2005 18:36:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Nov 2005 18:36:37 -0000 Received: (qmail 70618 invoked by uid 500); 7 Nov 2005 18:36:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 70582 invoked by uid 500); 7 Nov 2005 18:36:35 -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 70573 invoked by uid 99); 7 Nov 2005 18:36:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2005 10:36:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2005 10:36:29 -0800 Received: from phys-mpk-1 ([129.146.11.81]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id jA7IaED7004108 for ; Mon, 7 Nov 2005 11:36:14 -0700 (MST) Received: from conversion-daemon.mpk-mail1.sfbay.sun.com by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IPL00D01KNYGE@mpk-mail1.sfbay.sun.com> (original mail from David.Vancouvering@Sun.COM) for derby-dev@db.apache.org; Mon, 07 Nov 2005 10:36:14 -0800 (PST) Received: from [129.144.89.64] (d-sfo07-89-64.SFBay.Sun.COM [129.144.89.64]) by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IPL00CYLKXSPM@mpk-mail1.sfbay.sun.com> for derby-dev@db.apache.org; Mon, 07 Nov 2005 10:34:40 -0800 (PST) Date: Mon, 07 Nov 2005 10:34:45 -0800 From: "David W. Van Couvering" Subject: Re: Duplication of first 5 characters of a SQLState In-reply-to: <436F6775.7080209@sun.com> To: derby-dev@db.apache.org Message-id: <436F9E45.3010505@sun.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_YqamvR7LgMiMwyZpzLgN0Q)" X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) References: <58ed70f50511041645i3d5bd714p2440c94ad13d228b@mail.gmail.com> <436F6775.7080209@sun.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_YqamvR7LgMiMwyZpzLgN0Q) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT It is possible to have multiple messages with the same SQL state. For example, 22007 is specifically called out in the SQL spec for "invalid datetime format." In HADB we actually use the same SQL State for many different errors (they are distinguishable by the SQLException errno rather than by SQL State). That said, it is likely that some or all of these are just mistakes and have no rationale. SQL State classes 42 and XJ are not defined in the spec (at least as far as I can find) so they are Derby-specific. David Rick Hillegas wrote: > Hi Deepa, > > Sql states are supposed to uniquely identify error conditions. To me > these look like different errors, each of which should have its own sql > state. Could you fix this while you're in there? It looks like there are > four sql states whose codes are duplicated: > > ij> select sql_state, count(sql_state) > from new org.apache.derby.diag.ErrorMessages() c > group by sql_state > having count(sql_state) > 1 > ; > SQL_&|2 > ----------------- > 22007|2 > 42601|2 > 42815|2 > XJ081|2 > > The duplications of 42601 and XJ081 look like mistakes to me. > > The other two sql states (22007 and 42815) have 11 character codes. The > header comment in SQLState.java explains the meaning of 5, 7, and 9 > character codes. But I don't see any explanation of these 11 character > codes. Can anyone shed some light on this? > > Thanks, > -Rick > > Deepa Remesh wrote: > >> For DERBY-682, I was adding SQLStates with severity >= >> session_severity to the test lang/errorCode.sql. While doing this, I >> found that the SQLState 'XJ081' appears two times in the message >> properties file with two different severity levels. Output from ij is: >> ij> select * from new org.apache.derby.diag.ErrorMessages() c where >> sql_state = 'XJ081'; >> SQL_&|MESSAGE >> |SEVERITY >> -------------------------------------------------------------------------------------------------------------------------------------------------- >> >> XJ081|Invalid value '{0}' passed as parameter '{1}' to method '{2}' >> |20000 >> XJ081|Conflicting create/restore/recovery attributes specified. >> |40000 >> >> SQLState.java has this: >> String INVALID_API_PARAMETER = "XJ081.S"; >> String CONFLICTING_RESTORE_ATTRIBUTES = "XJ081.C"; >> I checked the code and both these are exceptions are thrown from the >> code. >> >> The Javadoc for org.apache.derby.iapi.reference.SQLState says this: >> "If the state is seven characters long then only the first five will >> be seen by the error reporting code and exception." Can this >> duplication of first 5 characters in SQLState cause any problems? >> >> Thanks, >> Deepa >> >> > --Boundary_(ID_YqamvR7LgMiMwyZpzLgN0Q) Content-type: text/x-vcard; charset=utf-8; name=david.vancouvering.vcf Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=david.vancouvering.vcf begin:vcard fn:David W Van Couvering n:Van Couvering;David W org:Sun Microsystems, Inc.;Database Technology Group email;internet:david.vancouvering@sun.com title:Senior Staff Software Engineer tel;work:510-550-6819 tel;cell:510-684-7281 x-mozilla-html:TRUE version:2.1 end:vcard --Boundary_(ID_YqamvR7LgMiMwyZpzLgN0Q)--