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 "Daniel John Debrunner (JIRA)" <ji...@apache.org> on 2007/01/16 17:17:27 UTC

[jira] Created: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
--------------------------------------------------------------------------------

                 Key: DERBY-2245
                 URL: https://issues.apache.org/jira/browse/DERBY-2245
             Project: Derby
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 10.2.2.0, 10.2.1.6, 10.1.3.1, 10.1.2.1, 10.1.1.0, 10.0.2.1, 10.0.2.0
            Reporter: Daniel John Debrunner
            Priority: Minor


Such as REFRESH and PUBLICATION.
Not sure what the exact contents should be.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by Myrna van Lunteren <m....@gmail.com>.
On 10/24/07, Daniel John Debrunner (JIRA) <ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537469 ]
>
> Daniel John Debrunner commented on DERBY-2245:
> ----------------------------------------------
>
> Does a keyword being reserved has anything to do with this method, the JDBC javadoc as Knut Anders points out just says non-SQL 2003 keywords?
>
> In the list Myrna provides at least these are SQL 2003 keywords:
>
>  BIGINT,BOOLEAN,CALL,CURRENT_ROLE,ROLE,NONE
>
> The XML words are part of standard SQL, but maybe not SQL2003.
>
> I'm not sure though what the correct list should be, I can't figure out a use for this method so it's hard to tell what it should do.
>
>
Thx for your input, Dan...

I've not tried to find a real JDBC spec yet, but the api doc (for
1.4.2) indicates this method needs to return keywords not part of
SQL92:
"Retrieves a comma-separated list of all of this database's SQL
keywords that are NOT also SQL92 keywords".
And, the plot thickens when one looks at the 1.6 api doc, which says:
"Retrieves a comma-separated list of all of this database's SQL
keywords that are NOT also SQL:2003 keywords"

Does that mean we are supposed to return something different with 1.6
than earlier versions?

I know we're not supposed to base ourselves on other products, but a
little googleing found a MySQL 5.0 bug that was fixed by making this
method return reserved non-sql92 keywords...Another website suggests
that 'keyword' implies a reserved word...Just saying that if we return
(of course non-sql) reserved words here, it's not unusual.

I am hoping someone with better knowledge of the JDBC spec can
indicate if this is supposed to be *reserved* keywords or not, or if
it's totally up to the implementation.

Also, I would like it if someone could explain what it means if a
keyword is in the 'reserved-Non-SQL 92' section of sqlgrammar.jj; I'm
wondering if some of those are maybe in the wrong place.

Thx,
Myrna

[jira] Updated: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2245:
--------------------------------------

     Urgency: Normal
    Assignee:     (was: Saurabh Vyas)

Triaged for 10.5.2. Unassigned due to lack of activity.

> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466684 ] 

Knut Anders Hatlen commented on DERBY-2245:
-------------------------------------------

The first approach seems fine. I guess sqlgrammar.jj is the best place to find Derby's keywords. You'd probably be most interested in the two sections labelled /* Additional JSQL reserved keywords -- non-SQL92 reserved Keywords */ and  /* Additional JSQL keywords -- non-SQL92 non-reserved Keywords */.

Note that the javadoc at http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getSQLKeywords() says that only keywords that are not SQL:2003 keywords should be returned.

> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>         Assigned To: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Saurabh Vyas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466665 ] 

Saurabh Vyas commented on DERBY-2245:
-------------------------------------

I am interested in working on this. EmbedDatabaseMetaData implements getSQLKeywords() method & it returns some key words which are not supported by Derby (like REFRESH and PUBLICATION, I am also not sure about other keywords ).

Now we can have two approaches
 - to remove them from the return statement (i.e. only those KeyWords should be returned which are supported by derby) 
 - to implement these functionality.

First approach is simple & straight forward and I had modified the the getSQLKeywords() accordingly. Can someone please guide me to derby docs to find out what all keywords are supported by Derby so that I can modify the method for all the keywords.

Comments or suggestions ?

> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>         Assigned To: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537460 ] 

Myrna van Lunteren commented on DERBY-2245:
-------------------------------------------

Is this issue stalled? Revision 504234 only removed REFRESH and PUBLICATION.

I had a quick look, and it seems to me that the reason why a user would possibly want to return this is if it's assumed these keywords have a special effect, i.e. are reserved keywords.

Maybe someone can check on the JDBC spec and say whether this is true, but even if it is not explicit about this, I would suggest we return the list of reserved non-SQL 92 keywords.

So, instead of the current list: ALIAS,BIGINT,BOOLEAN,CALL,CLASS,COPY,DB2J_DEBUG,EXECUTE,EXPLAIN,FILE,FILTER,GETCURRENTCONNECTION,INDEX,INSTANCEOF,METHOD,NEW,OFF,PROPERTIES,RECOMPILE,RENAME,RUNTIMESTATISTICS,STATEMENT,STATISTICS,TIMING,WAIT
we make this method return the contents of the sqlgrammar.jj section titled '/* Additional JSQL reserved keywords -- non-SQL92 reserved Keywords */'

However, I - possibly erroneously - assumed that reserved meant that you'd get a syntax error if you tried to use them in a create table statement; but this is not the case, for instance, I can create a table with the name 'curdate' for instance. So, are the items listed here 'really' reserved (non-sql 92) keywords? How can I find out?

Assuming the ones on this list really are reserved keywords, I'd suggest toreturn:
  'BIGINT,BOOLEAN,CALL,CURDATE,CURRENT_ROLE,CURTIME,DATABASE,GETCURRENTCONNECTION,EXPLAIN,BIGINT,LONG,LTRIM,NONE,ROLE,RTRIM,SUBSTR,XML,XMLEXISTS,XMLPARSE,XMLQUERY,XMLSERIALIZE'







> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>            Assignee: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539961 ] 

Bryan Pendleton commented on DERBY-2245:
----------------------------------------

Myrna suggests: "- make getSQLKeywords return all non SQL keywords (i.e. both those in the reserved, and non-reserved area). "

This seems very reasonable to me. My expectation of this call is that it returns
information about words that this database might treat specially, so that I might
need to put them in quotation marks if I used them as the names of columns,
tables, views, etc. I could see this sort of information being useful if I was trying
to write a generic tool, like a DBA tool for creating tables, etc. -- I might want my
tool to warn my user that their chosen column name is a keyword in this database,
and did they want to choose a different name. So your proposed
implementation seems good to me.


> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>            Assignee: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


Re: [jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"Daniel John Debrunner (JIRA)" <ji...@apache.org> writes:

> I'm not sure though what the correct list should be, I can't figure
> out a use for this method so it's hard to tell what it should do.

To enable tools whether to quote identifiers or not, perhaps?

Dag


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537469 ] 

Daniel John Debrunner commented on DERBY-2245:
----------------------------------------------

Does a keyword being reserved has anything to do with this method, the JDBC javadoc as Knut Anders points out just says non-SQL 2003 keywords?

In the list Myrna provides at least these are SQL 2003 keywords:

  BIGINT,BOOLEAN,CALL,CURRENT_ROLE,ROLE,NONE

The XML words are part of standard SQL, but maybe not SQL2003.

I'm not sure though what the correct list should be, I can't figure out a use for this method so it's hard to tell what it should do.




> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>            Assignee: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Commented: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539417 ] 

Myrna van Lunteren commented on DERBY-2245:
-------------------------------------------

After lack of response on the list (except from Dan, thx) and some more thought:

- there is no mention of 'reserved' in the javadoc, and it's not clear what the behavior is supposed to be if you use a reserved keyword. So it's hard to verify what are
  really the reserved keywords. So we'll just take the current split between reserved and non-reserved in sqlgrammar.jj as truth.
- Wikipedia says: 'A keyword is a word or concept with special significance' and 'an identifier in a computer language that indicates a specific command '. So again, this suggests all keywords, not just reserved.
- the spirit of the call is to return non-sql keywords, not specific to which SQL spec. So, let's not make a difference between jdk16 and jdk14/15 (jdk16 says non-SQL2003, earlier says non-SQL92).

So, I propose to:
-  move the XML related (and any other non SQL99, but SQL2003 - which would they be?) keywords into the SQL reserved keywords area
-  modify the javadoc to say, SQL2003, rather than SQL92.
-  update any relevant docs
-  make getSQLKeywords return all non SQL keywords (i.e. both those in the reserved, and non-reserved area).




> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>            Assignee: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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


[jira] Assigned: (DERBY-2245) DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.

Posted by "Saurabh Vyas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saurabh Vyas reassigned DERBY-2245:
-----------------------------------

    Assignee: Saurabh Vyas

> DatabaseMetaData.getSQLKeywords() contains words that are not keywords in Derby.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-2245
>                 URL: https://issues.apache.org/jira/browse/DERBY-2245
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0
>            Reporter: Daniel John Debrunner
>         Assigned To: Saurabh Vyas
>            Priority: Minor
>
> Such as REFRESH and PUBLICATION.
> Not sure what the exact contents should be.

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