db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saurabh Vyas (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1763) Using RTRIM(LTRIM(col)) and group by col gives NPE
Date Tue, 12 Sep 2006 07:17:23 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1763?page=comments#action_12434080 ] 
            
Saurabh Vyas commented on DERBY-1763:
-------------------------------------

I tried to simulate the same  scenario on Derby-10.2  and it works fine here with no excption/assert.

ij version 10.2
ij> connect 'jdbc:derby:mydb;create=true';
ij> CREATE TABLE t1 (
c1 VARCHAR(10),
c2 VARCHAR(10)
);
0 rows inserted/updated/deleted
ij> INSERT INTO t1 VALUES('a', 'b');
1 row inserted/updated/deleted
ij> INSERT INTO t1 VALUES('c', 'd');
1 row inserted/updated/deleted
ij> SELECT RTRIM(LTRIM(c1)),
                 COUNT(*)
FROM t1
GROUP BY c1;
1         |2
----------------------
a         |1
c         |1

2 rows selected

Is the issue already fixed and a patch is available?
Any inputs on this ?
Well I am workin upon root causing it in 10.1.3 release.

> Using RTRIM(LTRIM(col)) and group by col gives NPE
> --------------------------------------------------
>
>                 Key: DERBY-1763
>                 URL: http://issues.apache.org/jira/browse/DERBY-1763
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1
>         Environment: Windows 2000, Sun JDK 1.4.2_10
>            Reporter: Christopher Schick
>
> When trying to execute a simple SQL Statement that includes both the RTRIM() and LTRIM()
functions on a column in the SELECT clause and contains a GROUP BY clause on that column,
the following Nullpointer Exception is thrown:
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> This does NOT happen, if only RTRIM() OR LTRIM() is used, or if no GROUP BY clause is
specified.
> This issue is quite urgent for us, as we don't see a workaround to achieve the desired
results.
> Attached an example table schema and the affected SELECT Statement.
> --------------------------------------------
> CREATE TABLE t1 (
> c1 VARCHAR(10),
> c2 VARCHAR(10)
> );
> INSERT INTO t1 VALUES('a', 'b');
> INSERT INTO t1 VALUES('c', 'd');
> SELECT RTRIM(LTRIM(c1)), 
>                  COUNT(*)
> FROM t1
> GROUP BY c1;

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

        

Mime
View raw message