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 "Kristian Waagan (JIRA)" <ji...@apache.org> on 2007/01/09 10:34:27 UTC

[jira] Created: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

'show indexes in SCHEMANAME' does not work with the client driver
-----------------------------------------------------------------

                 Key: DERBY-2222
                 URL: https://issues.apache.org/jira/browse/DERBY-2222
             Project: Derby
          Issue Type: Bug
          Components: Network Client, Tools
    Affects Versions: 10.2.2.0, 10.3.0.0
            Reporter: Kristian Waagan


The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
It does work with the embedded driver.

Sample output from ij:
ij> connect 'jdbc:derby://localhost/myDB;create=true';
ij> create table test (id int primary key);
0 rows inserted/updated/deleted
ij> show indexes in app;
ERROR XJ103: Table name can not be null
ij> show indexes from test;
TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
----------------------------------------------------------------------------
TEST                |ID                  |0     |3   |A   |NULL    |NULL

1 row selected
ij> show indexes from app.test;
TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
----------------------------------------------------------------------------
TEST                |ID                  |0     |3   |A   |NULL    |NULL

1 row selected
ij>

Using delimited table and/or schema names does not work, but I think this is according to documentation.
I.e.:
ij> show indexes from "TEST";
ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
ij> show indexes from "APP".test;
ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
ij> show indexes from "APP"."TEST";
ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
ij>

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

        

[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

John H. Embretsen commented on DERBY-2222:
------------------------------------------

Kristian wrote:
-----------------------------------------------------------------

> Using delimited table and/or schema names does not work, but I think this is according to documentation.


What documentation are you referring to here? I think this is related to DERBY-2019 (the DESCRIBE command does not handle delimited/quoted names), but I was not able to find anything in the manuals saying this should not work.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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

        

[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Attachment: DERBY-2222-3.stat
                DERBY-2222-3.diff

Grant license...

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.diff, DERBY-2222-3.stat, DERBY-2222-3.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Resolved: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

Kristian Waagan resolved DERBY-2222.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.3.0.0
                   10.2.3.0

Committed 'DERBY-2222-3.diff' to trunk with revision 536100.
Merged to 10.2 with revision 536107.

Ran derbyall/suitesall (1.4, 1.5 and 1.6) for trunk, run for 10.2 is in progress now. Will report back and take corrective action if it shows problems.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.diff, DERBY-2222-3.stat, DERBY-2222-3.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Derby Info:   (was: [Patch Available])

Thanks for reviewing the patch, Kristian.

I have made a new patch that will supersed (2), and will attach it as soon as the tests have terminated. The patch addresses your comments:

1-4) Fixed
5) Ohh... forgot these! Thanks. The methods are modified in the new patch. 
6) I know, but I considered it better to continue the naming convention used for ij*.java files. Not changed.
7) You are right, and as far as i can tell the other tests in ij7.sql are performed only in embedded mode as well. I will start a subtask to address this.

Kristian Waagan (JIRA) wrote:
> I'm considering committing the v2 patch, but have a few comments. The tests run cleanly, so the comments are more like nits.
> 
>  1) Some new code seem to be mixing tabs and spaces for indentation. The current guidelines can be found here: http://www.nabble.com/-VOTE---Approve-coding-conventions-for-the-Derby-project-p5771191.html. I always use spaces if I change more than a few consecutive lines, even if the rest of the file has tabs.
> 
>  2) Lines longer than 80 characters.
> 
>  3) The name of the methods 'getDisplayColumns' and 'getColumnWidths' are very generic, where as their comments indicate they are special methods that are only used for displaying index information. Can the names or the comments be changed (as appropriate) to be more in agreement?
> 
>  4) The comment " //TODO: may want to change tabletype" in 'ij.jj' doesn't make much sense to me. Do I need to study the code to figure out what it means, or can it be made clearer/removed?
> 
>  5) For empty method bodies, it might be nice with a one-liner explaining why it is empty. For instance, I assume the method 'clearSQLWarnings' in 'ijMultipleResultSetResult.java' is a no-op because it can't get any warnings.
> 
>  6) The class 'ijMultipleResultSetResult' does not follow common naming guidelines for Java classes, since the start of the name is in lower case. I observe that this is the case for quite a lot of the files in the java/tools directories.
> 
>  7) I wasn't able to quickly determine if the modified test (ij7.sql) is run with the client driver. Do you know? I did search a derbyall_pass.txt file (on a run with no errors), but only found the test listed once.


> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

John H. Embretsen commented on DERBY-2222:
------------------------------------------

The documentation for the SHOW and DESCRIBE commands does not use the term "Identifier" at all, so I did not think about looking up that in the manual. But if table-Name, view-Name and schemaName are considered identifiers, and double quotes are considered delimiters, then I think these issues cannot be considered as bugs per se. But the documentation should clarify this, and I would be happy to see support for this getting improved.

As it is today, the SHOW and DESCRIBE commands cannot be used for case-sensitive names. Some tools (such as the NetBeans 5.0/5.5 Derby/Java DB module) put quotes around such names by default, making this a potential issue for many users.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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

        

[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494213 ] 

Jørgen Løland commented on DERBY-2222:
--------------------------------------

Thanks for committing this patch, Kristian.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.diff, DERBY-2222-3.stat, DERBY-2222-3.stat, derby-2222-4a-javadoc_whitespace.diff, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Closed: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

Kristian Waagan closed DERBY-2222.
----------------------------------


Verified fix in client driver.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.diff, DERBY-2222-3.stat, DERBY-2222-3.stat, derby-2222-4a-javadoc_whitespace.diff, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

Kristian Waagan updated DERBY-2222:
-----------------------------------

    Attachment: derby-2222-4a-javadoc_whitespace.diff

Committed 'derby-2222-4a-javadoc_whitespace.diff' with a few JavaDoc and formatting fixes (space/tabs, long lines) to trunk and 10.2 (revisions 536111 and 536112).

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.diff, DERBY-2222-3.stat, DERBY-2222-3.stat, derby-2222-4a-javadoc_whitespace.diff, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Attachment: DERBY-2222-3.diff
                DERBY-2222-3.stat

All tests, except bootLock, run flawlessly. Patch (3) is now ready for review.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, DERBY-2222-3.diff, DERBY-2222-3.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Attachment: DERBY-2222-2.stat
                DERBY-2222-2.diff

Thanks for the comments, Knut. I have addressed them in patch
DERBY-2222-2.diff, as commented below. 

Since I am new to Derby, I am not sure if all the following test
information is required, but to much info is probably better than
to little: Patch (2) initially failed
derbyall (store/bootLock.java) and allsuites (synonym.sql in
LangScripts); in the synonym test "drop synonym mySyn;" (line 237
in synonym.sql), the views were listed in the reverse order
compared to the master file. Both failures disappeared after ant
clobber/svn update. The full tests have not been rerun after
this.


> Knut Anders Hatlen commented on DERBY-2222:
> -------------------------------------------
> 
> Hi Jørgen,
> I think you have found a good solution. Some comments to the attached code:
> 1) If you do "svn add" on ijMultipleResultSetResult.java, it will be included in the output from "svn diff" and you don't need to attach the file separately.

Done. Thanks for the tip.

> 2) indent_DisplayMultipleResults() seems to be very similar to indent_DisplayResults(). Is it possible to make indent_DisplayResults() more general (for instance, let it take an array/list of result sets) and use that method both in DisplayResults() and DisplayMultipleResults()?

A good point. I more or less cut'n pasted that method in the first diff file. I have now rewritten these to one single method.

> 3) Derby code normally uses 4 blanks for indentation.

Fixed

> 4) Perhaps you could add a test case for "show indexes in schemaname" so it is tested by the regression tests. Some other usages of "show indexes" are tested in tools/ij7.sql.

Added one test to this file. 

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Attachment: ijMultipleResultSetResult.java
                DERBY-2222-1.stat
                DERBY-2222-1.diff

By fixing DERBY-1484, DatabaseMetaData#getIndexInfo will no longer allow null values for the table name. This breaks the "show indexes" functionality of ij in its current implementation. 

To remedy this, the "show index" functionality has been rewritten to something like:

---- code ---
ij.jj#showIndexes (schema, table){

if (table != null) return new ijResultSetResult(dbmd.getIndexInfo(schema, table))
else 
  dbmd.getTables(schema)
  for each tablename in schema 
     resultSetList.add(dbmd.getIndexInfo(schema, table))
  return new ijMultipleResultSetResult(resultSetList)
---- /code ---

The posted patch adds a new subclass of ijResultImpl (currently called ijMultipleResultSetResult) that effectively is a List of ResultSet. JDBCDisplayUtil is modified to handle this by showing the banner first, and then show all the rows in all resultsets in the ijMultipleResultSetResult object. 

I will apply the same fix to all ij functionality that uses methods in DatabaseMetaData where table = null is no longer allowed. See DERBY-1484 for details.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Updated: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland updated DERBY-2222:
---------------------------------

    Derby Info: [Patch Available]

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

Kristian Waagan commented on DERBY-2222:
----------------------------------------

I'm considering committing the v2 patch, but have a few comments. The tests run cleanly, so the comments are more like nits.

 1) Some new code seem to be mixing tabs and spaces for indentation. The current guidelines can be found here: http://www.nabble.com/-VOTE---Approve-coding-conventions-for-the-Derby-project-p5771191.html. I always use spaces if I change more than a few consecutive lines, even if the rest of the file has tabs.

 2) Lines longer than 80 characters.

 3) The name of the methods 'getDisplayColumns' and 'getColumnWidths' are very generic, where as their comments indicate they are special methods that are only used for displaying index information. Can the names or the comments be changed (as appropriate) to be more in agreement?

 4) The comment " //TODO: may want to change tabletype" in 'ij.jj' doesn't make much sense to me. Do I need to study the code to figure out what it means, or can it be made clearer/removed?

 5) For empty method bodies, it might be nice with a one-liner explaining why it is empty. For instance, I assume the method 'clearSQLWarnings' in 'ijMultipleResultSetResult.java' is a no-op because it can't get any warnings.

 6) The class 'ijMultipleResultSetResult' does not follow common naming guidelines for Java classes, since the start of the name is in lower case. I observe that this is the case for quite a lot of the files in the java/tools directories.

 7) I wasn't able to quickly determine if the modified test (ij7.sql) is run with the client driver. Do you know? I did search a derbyall_pass.txt file (on a run with no errors), but only found the test listed once.


I'll wait a little for feedback on my comments before I commit.

thanks,

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, DERBY-2222-2.diff, DERBY-2222-2.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491552 ] 

Jørgen Løland commented on DERBY-2222:
--------------------------------------

I forgot; this also solves issue 2222: both client and embedded can now perform "show indexes in SCHEMANAME" without getting

ERROR XJ103: Table name can not be null 

as described in the ij reference

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Assigned: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jørgen Løland reassigned DERBY-2222:
------------------------------------

    Assignee: Jørgen Løland

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

Posted by "Jørgen Løland (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490953 ] 

Jørgen Løland commented on DERBY-2222:
--------------------------------------

The reason why this works for the embedded driver but not the client one is that the client calls org/apache/derby/client/am/DatabaseMetaData#getIndexInfo which throws  SQLException if table == null. The embedded client calls the org/apache/derby/impl/jdbc/EmbedDatabaseMetaData#getIndexInfo which does not perform this check. 

According to the JDBC API, the getIndexInfo methods should not allow null values for the table name. Hence, as part of issue 1484, EmbedDatabaseMetaData#getIndexInfo will be changed to throw an SQLException as well. 

However, the ij reference says that (http://db.apache.org/derby/docs/dev/tools/rtoolsijcomrefshow.html):

SHOW
{
   CONNECTIONS |
   INDEXES [ IN schemaName | FROM table-Name ] |
   PROCEDURES [ IN schemaName ] |
   SCHEMAS |
   SYNONYMS [ IN schemaName ] |
   TABLES [ IN schemaName ] |
   VIEWS [ IN schemaName ] |

}
(...)
SHOW INDEXES displays all the indexes in the database.

If IN schemaName is specified, then only the indexes in the specified schema are displayed.

This is the same behavior currently observed by the embedded client, but not after issue 1484 is resolved. How should this best be solved? Two possible solutions are:

1) Change the ij reference so that "show indexes in app;" is not allowed.
2) When "show indexes in app" is performed, first get all tables in schema app, and then get all indexes for the tables one at a time. This would probably require a means to merge multiple resultsets into one ijResult. Is this possible with any existing Class?

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

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

Hi Jørgen,
I think you have found a good solution. Some comments to the attached code:
1) If you do "svn add" on ijMultipleResultSetResult.java, it will be included in the output from "svn diff" and you don't need to attach the file separately.
2) indent_DisplayMultipleResults() seems to be very similar to indent_DisplayResults(). Is it possible to make indent_DisplayResults() more general (for instance, let it take an array/list of result sets) and use that method both in DisplayResults() and DisplayMultipleResults()?
3) Derby code normally uses 4 blanks for indentation.
4) Perhaps you could add a test case for "show indexes in schemaname" so it is tested by the regression tests. Some other usages of "show indexes" are tested in tools/ij7.sql.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Jørgen Løland
>         Attachments: DERBY-2222-1.diff, DERBY-2222-1.stat, ijMultipleResultSetResult.java
>
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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


[jira] Commented: (DERBY-2222) 'show indexes in SCHEMANAME' does not work with the client driver

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

Kristian Waagan commented on DERBY-2222:
----------------------------------------

I kind of assumed 'schemaName' was an identifier. The description for identifier says this (http://db.apache.org/derby/docs/dev/tools/tools-single.html#rtoolsijcomref40155):
"Identifier
Syntax

Identifier

Description
Some ij commands require identifiers. These ij identifiers are case-insensitive. They must begin with a letter in the range A-Z, and can consist of any number of letters in the range A-Z, digits in the range 0-9, and underscore (_) characters.
These identifiers exist within the scope of ij only and are distinct from any identifiers used in SQL commands, except in the case of the Get Cursor command. The Get Cursor command specifies a cursor name to use in creating a result set.
ij does not recognize or permit delimited identifiers in ij commands. They can be used in SQL commands.
Example

These are valid ij identifiers: 
foo1 
exampleIdentifier12345 
another_one"

Maybe I'm wrong, but it's a bit hard to understand from the documentation. Some identifiers are linked to the page I mentioned, some are not. and others again might not be identifiers at all! If th latter is the case, then show indexes also has bugs in the handling of delimited/quoted table and schema names.

> 'show indexes in SCHEMANAME' does not work with the client driver
> -----------------------------------------------------------------
>
>                 Key: DERBY-2222
>                 URL: https://issues.apache.org/jira/browse/DERBY-2222
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Tools
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>
> The ij command 'show indexes in SCHEMANAME' does not work at all with the client driver.
> It does work with the embedded driver.
> Sample output from ij:
> ij> connect 'jdbc:derby://localhost/myDB;create=true';
> ij> create table test (id int primary key);
> 0 rows inserted/updated/deleted
> ij> show indexes in app;
> ERROR XJ103: Table name can not be null
> ij> show indexes from test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij> show indexes from app.test;
> TABLE_NAME          |COLUMN_NAME         |NON_U&|TYPE|ASC&|CARDINA&|PAGES
> ----------------------------------------------------------------------------
> TEST                |ID                  |0     |3   |A   |NULL    |NULL
> 1 row selected
> ij>
> Using delimited table and/or schema names does not work, but I think this is according to documentation.
> I.e.:
> ij> show indexes from "TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP".test;
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij> show indexes from "APP"."TEST";
> ERROR 42X01: Syntax error: Encountered "show" at line 1, column 1.
> ij>

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