db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2019) IJ's describe command does not handle quotes very well
Date Sat, 05 May 2007 15:23:15 GMT

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

Bryan Pendleton updated DERBY-2019:
-----------------------------------

    Attachment: describe_enhancement.diff

Attached is 'describe_enhancement.diff', a patch proposal.

I think it improves the behavior of the 'describe' command in the areas that John noted.

IJ's describe command already accepted a string for the table name,
although it expected single quotes, not double quotes. IJ seems to
prefer to use single quotes for its commands, as double quotes are
passed through to the underlying driver.

But there were several bugs with the handling of the table name in single quotes:
1) The table name was unnecessarily forced to upper case.
2) The command only worked properly if you gave both schema and table name.
3) It had a rather bizarre behavior with an empty string, as John observed.

So my patch proposal fixes those bugs, addresses the empty string
case by treating it as an error, adds a simple '*' feature as a wildcard, and
adds some new tests.

With the patch, 
   describe 'CamelCaseTable';
can be used to describe a table with a mixed-case name.

I'll make a separate proposal to add all this information to the docs at:
http://db.apache.org/derby/docs/dev/tools/rtoolsijcomrefdescribe.html

Please have a look at the patch and let me know what you think.


> IJ's describe command does not handle quotes very well
> ------------------------------------------------------
>
>                 Key: DERBY-2019
>                 URL: https://issues.apache.org/jira/browse/DERBY-2019
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.2.1.6, 10.3.0.0
>            Reporter: John H. Embretsen
>         Assigned To: Bryan Pendleton
>            Priority: Minor
>         Attachments: describe_enhancement.diff
>
>
> In IJ, the describe <table | view> command does not handle quotes very well. Current
behavior is:
> a) Double quotes:
> IJ does not recognize describe command when encountering double quotes.
>     ij> create table "CamelCaseTable" (col1_in_cct int);
>     0 rows inserted/updated/deleted
>     ij> describe "CamelCaseTable";
>     ERROR 42X01: Syntax error: Encountered "describe" at line 1, column 1.
> I'm assuming that it should be possible to execute the describe command on case-sensitive
table names.
> b) Single quotes:
> IJ describes all tables in current schema when encountering two single quotes after the
describe command.
>     ij> create table table1 (col1_table1 int);
>     0 rows inserted/updated/deleted
>     ij> create table table2 (col1_table2 int);
>     0 rows inserted/updated/deleted
>     ij> describe '';
>     COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
>     ------------------------------------------------------------------------------
>     COL1_TABLE1         |INTEGER  |0   |10  |10    |NULL      |NULL      |YES
>     COL1_TABLE2         |INTEGER  |0   |10  |10    |NULL      |NULL      |YES
>     
>     2 rows selected
> In case b), it does not make a difference whether the single quotes actually surround
a valid table name, some garbage, or nothing at all.
> I must admit that b) seems like a useful feature, listing all columns in all tables in
a schema, but it's usage is not very intuitive, nor is it documented, so this may be a bug.

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