You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2009/09/08 17:45:57 UTC

[jira] Reopened: (DERBY-4369) Give a more useful error message when join specification is missing

     [ https://issues.apache.org/jira/browse/DERBY-4369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen reopened DERBY-4369:
---------------------------------------


I noticed that the commit introduced this JavaCC warning:

     [java] Warning: Choice conflict in [...] construct at line 9210, column 17.
     [java]          Expansion nested within construct and expansion following c
onstruct
     [java]          have common prefixes, one of which is: "on"
     [java]          Consider using a lookahead of 2 or more for nested expansion.

The main reason for filing this issue was that it seemed like making the join specification optional would be required in order to make CROSS JOIN work (and possibly NATURAL JOIN whenever that is implemented). Now it seems like CROSS JOIN (DERBY-4355) will need a separate rule in the parser anyway, so there is no actual need to make the join specification optional for the other join types, except for exposing the clearer error message.

Unless it turns out that this change will be required for DERBY-4355, I suggest we back out the changes made in this issue and close it as Won't Fix. That'll also save us one possible compatibility issue (the changed SQLState).

> Give a more useful error message when join specification is missing
> -------------------------------------------------------------------
>
>                 Key: DERBY-4369
>                 URL: https://issues.apache.org/jira/browse/DERBY-4369
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: derby-4369-1a.diff, releaseNote.html
>
>
> Currently, if a join is missing a join specification, we see the following rather cryptic message:
> ij> select * from t1 join t2;
> ERROR 42X01: Syntax error: Encountered "<EOF>" at line 1, column 24.
> Issue the 'help' command for general information on IJ command syntax.
> Any unrecognized commands are treated as potential SQL commands and executed directly.
> Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
> The parser already has code to check if the join specification is missing, but since the join specification is required in the grammar, we'll never get to that point in the code if it is missing. If we make the join specification optional in the grammar, the code path with the more helpful message will be enabled, and we'll see this instead:
> ij> select * from t1 join t2;
> ERROR 42Y11: A join specification is required with the 'INNER JOIN' clause.
> This will make it clearer what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.