[ 
https://issues.apache.org/jira/browse/DERBY-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676689#action_12676689
 ] 

digulla edited comment on DERBY-4071 at 2/25/09 8:13 AM:
---------------------------------------------------------------

This is the query:

[code]
SELECT *
FROM DEMO.TEST S
WHERE S.VCHR IN (
        SELECT   VCHR
        FROM     DEMO.TEST
        GROUP BY VCHR
        HAVING   COUNT (VCHR) > 1 
)
  AND CHR NOT IN (
        SELECT   MAX(CHR)
        FROM     DEMO.TEST T
        WHERE    S.VCHR = T.VCHR
        GROUP BY T.VCHR
        HAVING   COUNT(T.VCHR) > 1  
)
[code]

When you swap the two columns, the errors goes away.

My problem: I'm using Derby to replicate a legacy DB2 database in my unit tests 
so I can create patches for an existing system. Therefore, I'd like to have a 
solution for Derby 10.4.2.0 instead of swapping the columns. Is there a chance 
for a quick fix?

      was (Author: digulla):
    This is the query:

[code]
SELECT *
FROM DEMO.TEST S
WHERE S.VCHR IN (
        SELECT   VCHR
        FROM     DEMO.TEST
        GROUP BY VCHR
        HAVING   COUNT (VCHR) > 1 
)
  AND CHR NOT IN (
        SELECT   MAX(CHR)
        FROM     DEMO.TEST T
        WHERE    S.VCHR = T.VCHR
        GROUP BY T.VCHR
        HAVING   COUNT(T.VCHR) > 1  
)
[code]
  
> AssertFailure when selecting rows from a table with CHARACTER and VARCHAR 
> columns
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-4071
>                 URL: https://issues.apache.org/jira/browse/DERBY-4071
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.0
>            Reporter: Aaron Digulla
>         Attachments: DerbyTest.java
>
>
> When running a complex query on this table:
> [code]
> Create table DEMO.TEST (
>     CHR                            CHARACTER(26)                   ,
>     VCHR                           VARCHAR(25)                     )
> [code]
> then I get this exception:
> AssertFailure: ASSERT FAILED col1.getClass() (class ...SQLChar) expected to 
> be the same as col2.getClass() (class ....SQLVarchar)' was thrown while 
> evaluating an expression.

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

Reply via email to