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

Sylvain Leroux updated DERBY-4430:
----------------------------------

    Attachment: DERBY-4430.ij.out
                DERBY-4430.patch
                DERBY-4430.sql

Thanks for all these explanations.

Here is a second version of the patch. Now, I let the identifier() method 
untouched. But I have introduced an other method caIdentifier() (for case-aware 
identifier). Only the latter uses database meta data to check for the case 
policy of the DB.

I've changed the rules for DESCRIBE and SHOW to use that new method instead of 
the standard one.

Concerning the tests, it works against Postgre8.3. I join the corresponding SQL 
and IJ output.
 
I ran ToolScripts (with junit) without any error.
I ran derbyall (harness-style) with only an error with "bootLock" (?). Here is 
the relevant part of the report:
********* Diff file storeall/storemore/bootLock.diff
*** Start: bootLock jdk1.6.0_12 storeall:storemore 2009-11-14 12:05:11 ***
2,4d1
< expected exception
< SQLSTATE(XJ040): 
< SQLSTATE(XSDB6): 
Test Failed.
*** End:   bootLock jdk1.6.0_12 storeall:storemore 2009-11-14 12:05:44 ***
********* Diff file derbyall/storeall/storemore/bootLock.diff
*** Start: bootLock jdk1.6.0_12 storeall:storemore 2009-11-14 12:49:45 ***
2,4d1
< expected exception
< SQLSTATE(XJ040): 
< SQLSTATE(XSDB6): 
Test Failed.


> Make ij's SHOW and DESCRIBE commands more db agnostic
> -----------------------------------------------------
>
>                 Key: DERBY-4430
>                 URL: https://issues.apache.org/jira/browse/DERBY-4430
>             Project: Derby
>          Issue Type: Improvement
>          Components: Tools
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Sylvain Leroux
>            Priority: Minor
>         Attachments: DERBY-4430.ij.out, DERBY-4430.patch, DERBY-4430.patch, 
> DERBY-4430.sql, DERBY-4430.sql
>
>
> ij's SHOW and DESCRIBE commands use DatabaseMetaData in order to be portable 
> to other databases than Derby, and in many cases they work fine with other 
> databases. However, the variants of the commands that take a table name or a 
> schema name assume that unquoted identifiers are converted to and stored in 
> upper case internally. This is not true for all databases, and since these 
> commands don't accept quoted identifiers, there's currently no way to access 
> tables/schemas that are not all upper case.
> One possible fix is to make the identifier() method in ij.jj use the 
> DatabaseMetaData methods storesLowerCaseIdentifiers(), 
> storesMixedCaseIdentifiers() and storesUpperCaseIdentifiers() to decide 
> whether it should convert the identifier to lower case, keep it unchanged, or 
> convert it to upper case. Currently, that method always converts the 
> identifiers to upper case.

-- 
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