Changeset: 361fc7902a94 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=361fc7902a94
Modified Files:
tests/Test_PSlargebatchval.java
Branch: default
Log Message:
Extend PreparedStatement test with calling setClob(int, Clob) and setClob(int,
Reader) methods.
This completes the fix for bug 3470
diffs (52 lines):
diff --git a/tests/Test_PSlargebatchval.java b/tests/Test_PSlargebatchval.java
--- a/tests/Test_PSlargebatchval.java
+++ b/tests/Test_PSlargebatchval.java
@@ -7,6 +7,7 @@
*/
import java.sql.*;
+import java.io.StringReader;
import java.util.*;
import java.nio.charset.Charset;
@@ -26,18 +27,37 @@ public class Test_PSlargebatchval {
for (int i = 0; i < 8170;i++) {
repeatedErrorStr.append(errorStr);
}
+ String largeStr = repeatedErrorStr.toString();
try {
stmt.execute("CREATE TABLE x (c INT, a CLOB, b
DOUBLE)");
pstmt = con.prepareStatement("INSERT INTO x VALUES
(?,?,?)");
- pstmt.setLong(1, 1);
- pstmt.setString(2, repeatedErrorStr.toString());
+
+ pstmt.setLong(1, 1L);
+ pstmt.setString(2, largeStr);
pstmt.setDouble(3, 1.0);
pstmt.addBatch();
pstmt.executeBatch();
- stmt.execute("DROP TABLE x");
+
+ /* test issue reported at
https://www.monetdb.org/bugzilla/show_bug.cgi?id=3470 */
+ pstmt.setLong(1, -2L);
+ pstmt.setClob(2, new StringReader(largeStr));
+ pstmt.setDouble(3, -2.0);
+ pstmt.addBatch();
+ pstmt.executeBatch();
+
+ Clob myClob = con.createClob();
+ myClob.setString(1L, largeStr);
+
+ pstmt.setLong(1, 123456789L);
+ pstmt.setClob(2, myClob);
+ pstmt.setDouble(3, 12345678901.98765);
+ pstmt.addBatch();
+ pstmt.executeBatch();
pstmt.close();
+
+ stmt.execute("DROP TABLE x");
stmt.close();
} catch (SQLException e) {
System.out.println("FAILED :( "+ e.getMessage());
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list