# HG changeset patch # User Martin van Dinther <martin.van.dinther@monetdbsolutions.com> # Date 1568307343 -7200 # Node ID ca6a4b02d4180dd265d8bfb2cd0eb47f2e386ec7 # Parent aa654804af6aafaf264c353206ee03f4556a695c 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). 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"); }