db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5749) VARCHAR args to stored methods are silently truncated if too long for the argument type.
Date Tue, 08 May 2012 19:47:49 GMT

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

Rick Hillegas commented on DERBY-5749:

This is my reading of the SQL Standard in this area:

According to part 2, section 10.4 (<routine invocation>), Syntax Rule 8.c, argument
passing is supposed to satisfy the same rules as storing data in a column.

Those rule are declared in part 2, section 9.2 (Store assignment). There, General Rule 2.b.v.2
says that the database should raise an exception if truncation occurs when stuffing a string
value into a varchar.

Derby may be deliberately inserting implicit CASTs in order to fix some other bug. The CASTs
downgrade the exception to a warning. The truncation behavior of CASTs is described in part
2, section 6.12 (<cast specification>), General Rules 10.c.ii and 11.c.ii. 
> VARCHAR args to stored methods are silently truncated if too long for the argument type.
> ----------------------------------------------------------------------------------------
>                 Key: DERBY-5749
>                 URL: https://issues.apache.org/jira/browse/DERBY-5749
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions:,,,,,,,,,,,,,,,,,,,
>            Reporter: Dag H. Wanvik
>         Attachments: SilentVarcharArgTruncation.java
> Cf the attached repro SilentVarcharArgTruncation.
> It seem implicit casts are inserted here, cf discussion on derby-dev thread starting
here: http://mail-archives.apache.org/mod_mbox/db-derby-dev/201205.mbox/%3Cx67gwm7hir.fsf%40oracle.com%3E

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


View raw message