Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4369

Give a more useful error message when join specification is missing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 10.6.1.0
    • None
    • SQL
    • None

    Description

      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.

      Attachments

        1. derby-4369-1a.diff
          8 kB
          Knut Anders Hatlen
        2. releaseNote.html
          4 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: