db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4430) Make ij's SHOW and DESCRIBE commands more db agnostic
Date Sun, 08 Nov 2009 13:47:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774776#action_12774776
] 

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

Thanks for the patch, Sylvain! I had a quick look at it and it looks good. I'll give it a
try.

To your questions:

1) I wouldn't worry too much about the calls to getMetaData(). Both the client driver and
the embedded driver cache the DatabaseMetaData object in the Connection object, and DatabaseMetaData
caches the values returned by stores*CaseIdentifiers, so I think there would be little to
gain by caching them ourselves in ij.

2) The ij7.sql test is run by the ToolScripts JUnit test. I see the same failure as you if
I run it with the old style runner, o.a...functionTests.harness.RunTest, but not if I run
it using the JUnit runner:

java junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.tools.ToolScripts

3) The English locale is used to prevent the JVM's default locale from influencing how the
identifiers are handled. For instance, in Turkish locale, toUpper("insert") returns "─░NSERT"
(note the upper-case i with a dot), and toLower("INSERT") returns "─▒nsert" (dot-less lower-case
i).

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


Mime
View raw message