[ 
https://issues.apache.org/jira/browse/DERBY-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512583
 ] 

Daniel John Debrunner commented on DERBY-2937:
----------------------------------------------

based up some investigation and analysis of internal testing Myrna found that 
svn revision 554399 for DERBY-2775 is the cause.

I have a fix, backing out some of the changes for that fix but I want to 
investigate more as the fix really indicates that the ColumnReference node is 
doing more that its name suggests. In this case the ColumnReference has a 
different type to its source, it would be good to know it what situations that 
occurs, as a simple reading of the class would not indicate that it has a role 
in changing the type of its source.

> ERROR 22011: The second or third argument of the SUBSTR function is out of 
> range   with data concatenation in group by query.
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2937
>                 URL: https://issues.apache.org/jira/browse/DERBY-2937
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Daniel John Debrunner
>            Assignee: Daniel John Debrunner
>
> CREATE TABLE A (C CHAR(10) NOT NULL, D DATE NOT NULL, DC DECIMAL(6,2));
> INSERT INTO A  VALUES ('aaa', DATE('2007-07-10'), 500.00);     
> SELECT A.C, SUBSTR (MAX(CAST(A.D AS CHAR(10)) || CAST(A.DC AS CHAR(8))), 11, 
> 8) AS BUG
>  FROM A GROUP BY A.C;
> results in a 22011 error on the select.
> ij> C         |BUG
> -------------------
> ERROR 22011: The second or third argument of the SUBSTR function is out of 
> range
> Note that the ResultSetMetaData seems to indicate to ij that the column width 
> of "BUG' is four instead of 18.

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