Changeset: e16c4bb803ce for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e16c4bb803ce
Modified Files:
        java/ChangeLog.Dec2011
        java/src/nl/cwi/monetdb/jdbc/MonetStatement.java
Branch: Dec2011
Log Message:

JDBC: fix "overflow" due to very large statements

Off-by-one error that was never triggered before, because offset and max
were never equal.  However, for bug #2952 the first statement is larger
than what the MAPI block can hold, and hence offset = i = 0.  max is
expected to be a count, though.

Fixes bug #2952


diffs (34 lines):

diff --git a/java/ChangeLog.Dec2011 b/java/ChangeLog.Dec2011
--- a/java/ChangeLog.Dec2011
+++ b/java/ChangeLog.Dec2011
@@ -1,6 +1,9 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Wed Dec 21 2011 Fabian Groffen <[email protected]>
+- Fixed overflow error when batching large statements, bug #2952
+
 * Tue Dec 20 2011 Fabian Groffen <[email protected]>
 - Resolved a concurrency problem where ResultSet's date-related getters
   could cause odd stack traces when used by multiple threads at the
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetStatement.java
@@ -215,7 +215,7 @@ public class MonetStatement extends Mone
                                        tmpBatch.append(sep);
                                tmpBatch.append(tmp);
                                // send and receive
-                               error |= internalBatch(tmpBatch.toString(), 
counts, offset, i, e);
+                               error |= internalBatch(tmpBatch.toString(), 
counts, offset, i + 1, e);
                                offset = i;
                                tmpBatch.delete(0, tmpBatch.length());
                                first = true;
@@ -223,7 +223,7 @@ public class MonetStatement extends Mone
                        }
                        if (tmpBatch.length() + sep.length() + tmp.length() >= 
MapiSocket.BLOCK) {
                                // send and receive
-                               error |= internalBatch(tmpBatch.toString(), 
counts, offset, i, e);
+                               error |= internalBatch(tmpBatch.toString(), 
counts, offset, i + 1, e);
                                offset = i;
                                tmpBatch.delete(0, tmpBatch.length());
                                first = true;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to