db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DERBY-2105) Network Client - Column of type CHAR, VARCHAR or LONG VARCHAR contains wrong value after being updated using the updateObject() method with a clob as parameter.
Date Thu, 24 Apr 2008 12:49:21 GMT

     [ https://issues.apache.org/jira/browse/DERBY-2105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kathey Marsden resolved DERBY-2105.
-----------------------------------

    Resolution: Invalid

The wrong results seems to no longer be an issue.  The case throws what appears to be an acceptable
error message for both embedded and client.



> Network Client - Column of type CHAR, VARCHAR or LONG VARCHAR contains wrong value after
being updated using the updateObject() method with a clob as parameter.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2105
>                 URL: https://issues.apache.org/jira/browse/DERBY-2105
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Fernanda Pizzorno
>
> REPRO:
>             Statement stmt1 = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
>                     ResultSet.CONCUR_UPDATABLE);
>             Statement stmt2 = conn.createStatement();
>             stmt1.executeUpdate("CREATE TABLE t1 (i int, c char(60))");
>             stmt1.executeUpdate("CREATE TABLE t2 (i int, c clob(1K))");
>             stmt1.executeUpdate("INSERT INTO t1 values (1, 'xx')");
>             stmt1.executeUpdate("INSERT INTO t2 values (1, 'yy')");
>             ResultSet rs1 = stmt1.executeQuery("SELECT * FROM t1");
>             ResultSet rs2 = stmt2.executeQuery("SELECT * FROM t2");
>             if (!rs1.next()) {
>                 System.out.println("Row not found");
>                 return;
>             }
>             if (!rs2.next()) {
>                 System.out.println("Row not found");
>                 return;            
>             }
>             rs1.updateObject(2, rs2.getClob(2));
>             rs1.updateRow();
>             rs1.close();
>             rs1 = stmt1.executeQuery("SELECT * FROM t1");
>             if (!rs1.next()) {
>                 System.out.println("Row not found");
>                 return;
>             }
>             if (!rs2.getString(2).equals(rs1.getString(2))) {
>                 System.out.println("FAIL - wrong value for column 2 expected: " + 
>                         rs2.getString(2) + " but was: " + rs1.getString(2));
>             }
>             rs1.close();
>             rs2.close();        
>             stmt1.close();
>             stmt2.close();
> OUTPUT:
> FAIL - wrong value for column 2 expected: yy but was: org.apache.derby.client.am.Clob@336d8196

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message