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 "Rajesh Kartha (JIRA)" <de...@db.apache.org> on 2006/09/09 03:11:22 UTC

[jira] Created: (DERBY-1837) Select from a derived table does not return the aliased column names in some cases

Select from a derived table does not return the aliased column names in some cases
----------------------------------------------------------------------------------

                 Key: DERBY-1837
                 URL: http://issues.apache.org/jira/browse/DERBY-1837
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.1.3.1, 10.1.3.0, 10.1.2.1, 10.1.1.0, 10.0.2.1, 10.0.2.0
         Environment: Any
            Reporter: Rajesh Kartha
            Priority: Minor


A select from a derived table does not return the aliased  column names correctly if the selected column(s) are char(1). The column names
show up as '&' in the following example:

ij> select * from (values('a','a')) as a(c1,c2);
&|&
---
a|a

1 row selected
ij> select * from (values('a','aa')) as a(c1,c2);
&|C2
----
a|aa

1 row selected
ij> select * from (values('aaa','a')) as a(c1,c2);
C1 |&
-----
aaa|a

1 row selected
ij> select * from (values(1,'a')) as a(c1,c2);
C1         |&
-------------
1          |a

1 row selected

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

        

[jira] Updated: (DERBY-1837) Select from a derived table does not return the aliased column names in some cases

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1837?page=all ]

Daniel John Debrunner updated DERBY-1837:
-----------------------------------------

    Component/s: Tools
                     (was: SQL)

This, I think, is a feature of ij, not SQL. Ij is basing its column width on the display size of the column, in the case one.
ij then tries to fit the column name into the display size of the column, again one, indicating it is truncated with
an '&' symbol. So in this case, there is only space for '&'.

Maybe ij could have some minimum display size for a column, so that  at least some of the column name was displayed.

> Select from a derived table does not return the aliased column names in some cases
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-1837
>                 URL: http://issues.apache.org/jira/browse/DERBY-1837
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.0, 10.1.3.1
>         Environment: Any
>            Reporter: Rajesh Kartha
>            Priority: Minor
>
> A select from a derived table does not return the aliased  column names correctly if the selected column(s) are char(1). The column names
> show up as '&' in the following example:
> ij> select * from (values('a','a')) as a(c1,c2);
> &|&
> ---
> a|a
> 1 row selected
> ij> select * from (values('a','aa')) as a(c1,c2);
> &|C2
> ----
> a|aa
> 1 row selected
> ij> select * from (values('aaa','a')) as a(c1,c2);
> C1 |&
> -----
> aaa|a
> 1 row selected
> ij> select * from (values(1,'a')) as a(c1,c2);
> C1         |&
> -------------
> 1          |a
> 1 row selected

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

        

[jira] Updated: (DERBY-1837) Select from a derived table does not return the aliased column names in some cases

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

Knut Anders Hatlen updated DERBY-1837:
--------------------------------------

    Issue & fix info: [Repro attached]
             Urgency: Normal

Triaged for 10.5.2.

> Select from a derived table does not return the aliased column names in some cases
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-1837
>                 URL: https://issues.apache.org/jira/browse/DERBY-1837
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1
>         Environment: Any
>            Reporter: Rajesh Kartha
>            Priority: Minor
>
> A select from a derived table does not return the aliased  column names correctly if the selected column(s) are char(1). The column names
> show up as '&' in the following example:
> ij> select * from (values('a','a')) as a(c1,c2);
> &|&
> ---
> a|a
> 1 row selected
> ij> select * from (values('a','aa')) as a(c1,c2);
> &|C2
> ----
> a|aa
> 1 row selected
> ij> select * from (values('aaa','a')) as a(c1,c2);
> C1 |&
> -----
> aaa|a
> 1 row selected
> ij> select * from (values(1,'a')) as a(c1,c2);
> C1         |&
> -------------
> 1          |a
> 1 row selected

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


[jira] Commented: (DERBY-1837) Select from a derived table does not return the aliased column names in some cases

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1837?page=comments#action_12433545 ] 
            
Daniel John Debrunner commented on DERBY-1837:
----------------------------------------------

Very strange, the problem does only seem to be for derived tables:

ij> create table t (c char(1), c1 char(1), cxxxxxxxxxxxxxx char(1));
0 rows inserted/updated/deleted
ij> select * from t;
C   |C1  |CXX&
--------------

0 rows selected
ij> select * from (values('a','a')) as a(c1,c2);
&|&
---
a|a

> Select from a derived table does not return the aliased column names in some cases
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-1837
>                 URL: http://issues.apache.org/jira/browse/DERBY-1837
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.0, 10.1.3.1
>         Environment: Any
>            Reporter: Rajesh Kartha
>            Priority: Minor
>
> A select from a derived table does not return the aliased  column names correctly if the selected column(s) are char(1). The column names
> show up as '&' in the following example:
> ij> select * from (values('a','a')) as a(c1,c2);
> &|&
> ---
> a|a
> 1 row selected
> ij> select * from (values('a','aa')) as a(c1,c2);
> &|C2
> ----
> a|aa
> 1 row selected
> ij> select * from (values('aaa','a')) as a(c1,c2);
> C1 |&
> -----
> aaa|a
> 1 row selected
> ij> select * from (values(1,'a')) as a(c1,c2);
> C1         |&
> -------------
> 1          |a
> 1 row selected

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

        

[jira] Commented: (DERBY-1837) Select from a derived table does not return the aliased column names in some cases

Posted by "Rajesh Kartha (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1837?page=comments#action_12433673 ] 
            
Rajesh Kartha commented on DERBY-1837:
--------------------------------------

I am positive now this an ij issue, if I create a simple jdbc test I am able to get the correct column names back.

                ResultSet rs=stmt.executeQuery("select * from (values('aaa','a')) as a(c1,c2)");
    		ResultSetMetaData rsmd=rs.getMetaData();
    		while(rs.next()){
    			System.out.println(rsmd.getColumnName(1)+"\t"+rsmd.getColumnName(2));
    			System.out.println(rs.getString(1)+"\t"+rs.getString(2));
    		}
    		System.out.println("====================================================");
    		rs=stmt.executeQuery("select * from (values('a','a')) as a(c1,c2)");
    		rsmd=rs.getMetaData();
    		while(rs.next()){
    			System.out.println(rsmd.getColumnName(1)+"\t"+rsmd.getColumnName(2));
    			System.out.println(rs.getString(1)+"\t"+rs.getString(2));
    		}

returns:

C1	C2
aaa	a
====================================================
C1	C2
a	a


> Select from a derived table does not return the aliased column names in some cases
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-1837
>                 URL: http://issues.apache.org/jira/browse/DERBY-1837
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.0, 10.1.3.1
>         Environment: Any
>            Reporter: Rajesh Kartha
>            Priority: Minor
>
> A select from a derived table does not return the aliased  column names correctly if the selected column(s) are char(1). The column names
> show up as '&' in the following example:
> ij> select * from (values('a','a')) as a(c1,c2);
> &|&
> ---
> a|a
> 1 row selected
> ij> select * from (values('a','aa')) as a(c1,c2);
> &|C2
> ----
> a|aa
> 1 row selected
> ij> select * from (values('aaa','a')) as a(c1,c2);
> C1 |&
> -----
> aaa|a
> 1 row selected
> ij> select * from (values(1,'a')) as a(c1,c2);
> C1         |&
> -------------
> 1          |a
> 1 row selected

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