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

Knut Anders Hatlen commented on DERBY-5235:
-------------------------------------------

> - I think there may be more complications regarding implementing this for 
> client/server than embedded.

It looks like the client has problems with the current limits too. For example, 
the following JUnit test case passes with the embedded driver, but returns a 
truncated value and fails with the client driver:

    public void testLongColumn() throws SQLException {
        PreparedStatement ps = prepareStatement(
                "values cast(? as varchar(20000))");

        char[] chars = new char[20000];
        Arrays.fill(chars, '\u4e10');
        String str = new String(chars);

        ps.setString(1, str);
        JDBC.assertSingleValueResultSet(ps.executeQuery(), str);
    }

The VARCHAR value seems to be truncated down to 32700 bytes (note: bytes, not 
characters!) and the wrong value is returned. I'll file a separate bug report 
for this issue.

> Remove the artificial limit on the length of VARCHAR values, allowing them to 
> be java.lang.Integer.MAX_VALUE long
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5235
>                 URL: https://issues.apache.org/jira/browse/DERBY-5235
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.9.0.0
>            Reporter: Rick Hillegas
>
> The original Cloudscape limit for the length of VARCHAR values was 
> java.lang.Integer.MAX_VALUE. That is the limit in Cloudscape 5.1. Nothing in 
> Derby should break if we restore the original limit. The current limit is an 
> artificial bound introduced to make Derby agree with DB2. 32672 is the upper 
> bound on the length of a DB2 VARCHAR: 
> http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0001029.htm

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to