db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A B (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1776) ERROR 42Z72: XML syntax error; missing keyword(s): 'AS'. - Misleading text
Date Mon, 18 Sep 2006 23:47:22 GMT
     [ 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:,
>            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


View raw message