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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2007/07/19 20:59:06 UTC

[jira] Created: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-2960
                 URL: https://issues.apache.org/jira/browse/DERBY-2960
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.4.0.0
            Reporter: Kathey Marsden


ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
, dc decimal(5,2));
0 rows inserted/updated/deleted
ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
1   |2
----------------

0 rows selected
ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
 date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
;
1 row inserted/updated/deleted
ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
 date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
;
1 row inserted/updated/deleted
ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
ity.AssertFailure'.



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


[jira] Commented: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514243 ] 

Mamta A. Satoor commented on DERBY-2960:
----------------------------------------

Checked in a fix for this into main (558036) and 10.3 codeline (558049). The commit comments were as follows

"select" query failed because we were generating SQLVarchar rather than CollatorSQLVarchar
create table alltypes (c char(10), v varchar(50));
insert into alltypes values ('duplicate', 'is duplicated');
select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;

To fix the problem, I needed to override StringDataValue getNewVarchar() in CollatorSQLVarchar. Without this new method, we were generating SQLVarchar in territory based databased when the collation type was territory based.



> Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2960
>                 URL: https://issues.apache.org/jira/browse/DERBY-2960
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.1.4, 10.4.0.0
>
>
> ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
> r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
> , dc decimal(5,2));
> 0 rows inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> 1   |2
> ----------------
> 0 rows selected
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
> e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
> ity.AssertFailure'.

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


[jira] Assigned: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

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

Mamta A. Satoor reassigned DERBY-2960:
--------------------------------------

    Assignee: Mamta A. Satoor

> Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2960
>                 URL: https://issues.apache.org/jira/browse/DERBY-2960
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Mamta A. Satoor
>
> ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
> r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
> , dc decimal(5,2));
> 0 rows inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> 1   |2
> ----------------
> 0 rows selected
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
> e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
> ity.AssertFailure'.

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


[jira] Resolved: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

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

Mamta A. Satoor resolved DERBY-2960.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.4.0.0
                   10.3.1.4

> Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2960
>                 URL: https://issues.apache.org/jira/browse/DERBY-2960
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.1.4, 10.4.0.0
>
>
> ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
> r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
> , dc decimal(5,2));
> 0 rows inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> 1   |2
> ----------------
> 0 rows selected
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
> e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
> ity.AssertFailure'.

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


[jira] Closed: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

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

Mamta A. Satoor closed DERBY-2960.
----------------------------------


> Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2960
>                 URL: https://issues.apache.org/jira/browse/DERBY-2960
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.1.4, 10.4.0.0
>
>
> ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
> r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
> , dc decimal(5,2));
> 0 rows inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> 1   |2
> ----------------
> 0 rows selected
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
> e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
> ity.AssertFailure'.

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


[jira] Commented: (DERBY-2960) Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514152 ] 

Mamta A. Satoor commented on DERBY-2960:
----------------------------------------

It appears that we are generating SQLVarchar rather than CollatorSQLVarchar for the query above. I am working on the problem.

> Group by substr() on collated database causes ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar):
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2960
>                 URL: https://issues.apache.org/jira/browse/DERBY-2960
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>
> ij> create table alltypes (i int, s smallint, l bigint, c char(10), v varchar(50), lvc long varchar,d double precision,
> r real, dt date, t time, ts timestamp, b char(2) for bit data, bv varchar(8) for bit data, lbv long varchar for bit data
> , dc decimal(5,2));
> 0 rows inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> 1   |2
> ----------------
> 0 rows selected
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> insert into alltypes values (0, 100, 1000000, 'duplicate', 'this is duplicated', 'also duplicated',200.0e0, 200.0e0,
>  date('1992-01-01'), time('12:30:30'), timestamp('1992-01-01 12:30:30'), X'12af', x'0000111100001111', X'1234', 111.11)
> ;
> 1 row inserted/updated/deleted
> ij> select substr(c||v, 1, 4), count(*) from alltypes group by substr(c||v, 1, 4) ;
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar) expected to b
> e the same as col2.getClass() (class org.apache.derby.iapi.types.CollatorSQLVarchar): org.apache.derby.shared.common.san
> ity.AssertFailure'.

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