[
https://issues.apache.org/jira/browse/DERBY-4793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165920#comment-13165920
]
Knut Anders Hatlen commented on DERBY-4793:
-------------------------------------------
Yes, it looks like an exception should be raised:
ISO/IEC 9075-2:2003 (E)
6.28 <string value expression>
General Rules
2) b) ii) 3) B) If the most specific type of either S1 or S2 is variable-length
character string, then let
VL be the implementation-defined maximum length of variable-length character
strings.
Case:
I) If M is less than or equal to VL, then the result of the <concatenation> is
S with
length M.
II) If M is greater than VL and the right-most M–VL characters of S are all the
<space>
character, then the result of the <concatenation> is the first VL
characters of S
with length VL.
III) Otherwise, an exception condition is raised: data exception — string data,
right
truncation.
> Assert failure when concatenating strings with total size greater than 32K
> --------------------------------------------------------------------------
>
> Key: DERBY-4793
> URL: https://issues.apache.org/jira/browse/DERBY-4793
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.6.1.0
> Reporter: Knut Anders Hatlen
> Labels: derby_triage10_8
> Attachments: concat.sql
>
>
> When concatenating two strings whose total length exceeds the maximum length
> for a VARCHAR, an assert is triggered in the debug jars:
> ij> values length('0123456789.....' || '0123456789.....');
> ERROR XJ001: Java exception: 'ASSERT FAILED The maximum length 35000 for the
> result type VARCHAR can't be greater than it's maximum width of result's
> typeid32672: org.apache.derby.shared.common.sanity.AssertFailure'.
> With non-debug jars, the same query completes successfully:
> ij> values length('0123456789.....' || '0123456789.....');
> 1
> -----------
> 35000
> 1 row selected
> I think this query is supposed to fail, also with non-debug jars, but in any
> even it shouldn't be raising assert failures.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira