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 "Daniel John Debrunner (JIRA)" <ji...@apache.org> on 2007/07/13 21:14:04 UTC

[jira] Created: (DERBY-2937) ERROR 22011: The second or third argument of the SUBSTR function is out of range with data concatenation in group by query.

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.


[jira] Commented: (DERBY-2937) ERROR 22011: The second or third argument of the SUBSTR function is out of range with data concatenation in group by query.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516994 ] 

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

The groupby.txt patch is incorrect, or at least it's not the best fix. Will commit a real fix soon.

> 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
>         Attachments: groupby.txt
>
>
> 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.


[jira] Closed: (DERBY-2937) ERROR 22011: The second or third argument of the SUBSTR function is out of range with data concatenation in group by query.

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

Daniel John Debrunner closed DERBY-2937.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.4.0.0

> 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
>             Fix For: 10.4.0.0
>
>         Attachments: groupby.txt
>
>
> 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.


[jira] Updated: (DERBY-2937) ERROR 22011: The second or third argument of the SUBSTR function is out of range with data concatenation in group by query.

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

Daniel John Debrunner updated DERBY-2937:
-----------------------------------------

    Attachment: groupby.txt

Partial back out of svn revision 554399

> 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
>         Attachments: groupby.txt
>
>
> 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.


[jira] Commented: (DERBY-2937) ERROR 22011: The second or third argument of the SUBSTR function is out of range with data concatenation in group by query.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ 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.