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

Eranda Sooriyabandara updated DERBY-2785:
-----------------------------------------

    Attachment: Derby-2785.diff

Hi Bryan,
I tried to work with new repo and get the following error
ij> describe run;
JAVA ERROR: java.lang.Error: Missing return statement in function
java.lang.Error: Missing return statement in function
        at org.apache.derby.impl.tools.ij.ij.caIdentifier(ij.java:2640)
        at org.apache.derby.impl.tools.ij.ij.DescTableStatement(ij.java:1445)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1110)
        at 
org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)

I check ij.java and see as follows

Token t=null;
    String i=null;
    if (jj_2_122(2)) {
      i = keyword();
    } else if (jj_2_123(2)) {
      t = jj_consume_token(IDENTIFIER);
        haveConnection();
        DatabaseMetaData dbmd = theConnection.getMetaData();
        String identifier = i;

        if(i==null)
            identifier = t.image;

        if (dbmd.storesLowerCaseIdentifiers())
            identifier = identifier.toLowerCase(Locale.ENGLISH);
        else if (dbmd.storesUpperCaseIdentifiers())
            identifier = identifier.toUpperCase(Locale.ENGLISH);

        {if (true) return identifier;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");

According to the code when we give a key word as table the error should appear.
Why this occurs suddenly? Here I am attaching the patch.
thanks

> ij "describe" built in command cannot describe a table named "run"
> ------------------------------------------------------------------
>
>                 Key: DERBY-2785
>                 URL: https://issues.apache.org/jira/browse/DERBY-2785
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.2.2.0
>         Environment: OS-X, Java 1.5
>            Reporter: Tim Halloran
>            Assignee: Eranda Sooriyabandara
>            Priority: Minor
>         Attachments: caidentifier.diff, caidentifier.diff, Derby-2785.diff, 
> derby-2785.diff, derby-2785.diff, derby-2785.diff, derby.log, 
> derbyall_report.txt, derbyall_report.txt, describeKeywords.diff, 
> junitAll.out, junitAll.out, step logs.txt, test.out
>
>
> steps to duplicate:
> (attach ij to any database)
> ij> create table run (i int);
> 0 rows inserted/updated/deleted
> ij> desc run;
> ERROR 42X01: Syntax error: Encountered "desc" at line 1, column 1.
> ij> 
> I think this is a parser problem within ij where the "run" is taken as a 
> token and that token is not included in the definition of a tablename 
> expression in the grammer (should be an easy fix).

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

Reply via email to