Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 37284 invoked from network); 18 Sep 2006 23:51:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Sep 2006 23:51:00 -0000 Received: (qmail 62565 invoked by uid 500); 18 Sep 2006 23:50:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 62524 invoked by uid 500); 18 Sep 2006 23:50:59 -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 62514 invoked by uid 99); 18 Sep 2006 23:50:59 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Sep 2006 16:50:59 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from ([209.237.227.198:45684] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 36/10-24436-1E03F054 for ; Mon, 18 Sep 2006 16:50:57 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 17BF9714304 for ; Mon, 18 Sep 2006 23:47:23 +0000 (GMT) Message-ID: <4241419.1158623242917.JavaMail.jira@brutus> Date: Mon, 18 Sep 2006 16:47:22 -0700 (PDT) From: "A B (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1776) ERROR 42Z72: XML syntax error; missing keyword(s): 'AS'. - Misleading text In-Reply-To: <16363432.1156861229791.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1776?page=all ] A B updated DERBY-1776: ----------------------- Attachment: d1776_v1.patch Well, after that paragraph of justification, it turns out that there are only three places where we use the 42Z79 SQLSTATE. But still, I think it's a useful error message and should be kept around; it could come in handy further down the road if SQL/XML functionality is expanded. As for line/column numbers, it turns out that those values are readily available from within sqlgrammar.jj and thus can easily be passed as part of the error message. The only potential downside that I can see is that we have to create an Integer object out of the line/col numbers in order to pass them to the StandardException constructor...but maybe that's not a big deal...? The fact that no one has done this earlier makes me wonder if there's some "gotcha" here that I'm missing, but I haven't seen any problems with it just yet... Attaching a patch d1776_v1.patch that changes the error message for 42Z79 as mentioned in my previous comment and also does the following: 1. Adds line and column numbers to the error message to indicate where the missing keyword is expected. 2. Removes one "lookahead" call that was causing 42Z79 to be raised for a missing "AS" keyword when in fact the keyword was present (what was missing was the datatype). To avoid confusion, I removed the lookahead and now the user will see a more generic 42X01 error in that particular case. 3. Updated xml_general master files accordingly. So with this patch applied, instead of: select xmlserialize(x) from t; ERROR 42Z72: XML syntax error; missing keyword(s): 'AS'. we'll now see: create table t (i int, x xml); ERROR 42Z72: Missing SQL/XML keyword(s) 'AS' at line 1, column 22. I ran xmlSuite with this patch and all of the tests passed. I haven't run derbyall yet and I don't expect any failures (since the changes are theoretically limited to XML) but I will try to run it tonight just for sanity. In the meantime, review comments would be great. > ERROR 42Z72: XML syntax error; missing keyword(s): 'AS'. - Misleading text > -------------------------------------------------------------------------- > > Key: DERBY-1776 > URL: http://issues.apache.org/jira/browse/DERBY-1776 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.2.1.0, 10.3.0.0 > Reporter: Daniel John Debrunner > Priority: Minor > Attachments: d1776_v1.patch > > > create table t (i int, x xml); > select xmlserialize(x) from t; > ERROR 42Z72: XML syntax error; missing keyword(s): 'AS'. > This is not an 'XML Syntax error', it's a syntax in the SQL language. No need to have a special error messgae here, wouldn't the error be caught by regular parsing? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira