changeset 327:ca6a4b02d418

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).
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 12 Sep 2019 18:55:43 +0200 (2019-09-12)
parents aa654804af6a
children 65bf0be846f3
files src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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");
 		}