db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eranda Sooriyabandara (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4256) allow alter table to increase the maximum size of a blob and a clob.
Date Tue, 11 Aug 2009 04:20:14 GMT

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

Eranda Sooriyabandara updated DERBY-4256:
-----------------------------------------

    Comment: was deleted

(was: Hi Bryan,
I test with your update and found some problems,

1.When I use the code as,

Statement st1 = conn.createStatement();
        st1.setCursorName("c1");
        ResultSet rs1 = st1.executeQuery("elect * from t1 where c2 = 2 for
update of c1");
        rs1.next();
        st.executeUpdate("update t1 set c1 = c1 where current of \"c1\"");
        assertStatementError("23513", st,
            "update t1 set c1 = c1 + 1 where current of \"c1\"");

it is successfully working but when I change the code as,

Statement st1 = conn.createStatement();
        st1.setCursorName("c1");
        ResultSet rs1 = st1.executeQuery("select * from t1 where c2 = 2 for
update of c1");
        rs1.next();
        expRS=new String[][]{
            {"2","2"}
        };
        JDBC.assertFullResultSet(rs1, expRS);
        st.executeUpdate("update t1 set c1 = c1 where current of \"c1\"");
        assertStatementError("23513", st,
            "update t1 set c1 = c1 + 1 where current of \"c1\"");

It gave me the error "unexpected row count:expected<1> but was<0>"  in the
line of "JDBC.assertFullResultSet(rs1, expRS);";.

I think this is because in the JDBC they called the rs.next() until it's
become false. So the cursor ends from there.
When we reach the line "st.executeUpdate("update t1 set c1 = c1 where
current of \"c1\"");" cursor not available. So we can't use both of them
together. I thought to skip the part of,
        expRS=new String[][]{
            {"2","2"}
        };
        JDBC.assertFullResultSet(rs1, expRS);
from the code.

So I try a method which successful at the end.I send it as a patch file
here.
If it is fine for you then I can do as the same thing for the rest of the
commented codes.
)

> allow alter table to increase the maximum size of a blob and a clob.
> --------------------------------------------------------------------
>
>                 Key: DERBY-4256
>                 URL: https://issues.apache.org/jira/browse/DERBY-4256
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Mike Matrigali
>            Assignee: Eranda Sooriyabandara
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: A.txt, Clob.java, derby4256.diff, derby4256.diff, derby4256.diff,
derby4256.diff, DERBY4282.diff, DERBY4282.diff
>
>
> Allow new syntax that allows user to alter the maximum length of a blob and/or clob column:
> ALTER TABLE binarydata ALTER COLUMN data SET DATA TYPE blob(128M)
> The syntax should match up with the existing functionality to increase the size of varchar
fields.

-- 
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