Changeset: ca6a4b02d418 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=ca6a4b02d418
Modified Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
Branch: default
Log Message:

Add optimisation for MonetClob.getSubString(pos, length) in case the whole 
string is requested.
This case is used by MonetPreparedStatement.setClob(int parameterIndex, Clob x).


diffs (14 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
@@ -124,6 +124,10 @@ public final class MonetClob implements 
        @Override
        public String getSubString(final long pos, final int length) throws 
SQLException {
                checkBufIsNotNull();
+               if (pos == 1L && length == buf.length()) {
+                       // the whole string is requested
+                       return buf.toString();
+               }
                if (pos < 1 || pos > buf.length()) {
                        throw new SQLException("Invalid pos value: " + pos, 
"M1M05");
                }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to