@@ -62,6 +62,7 @@ public static LocalResult forTable(SessionLocal session, Table table) {
6262private int visibleColumnCount ;
6363private int resultColumnCount ;
6464private Expression []expressions ;
65+ private boolean forDataChangeDeltaTable ;
6566private long rowId ,rowCount ;
6667private ArrayList <Value []>rows ;
6768private SortOrder sort ;
@@ -140,6 +141,13 @@ public void setMaxMemoryRows(int maxValue) {
140141this .maxMemoryRows =maxValue ;
141142 }
142143
144+ /**
145+ * Sets value collection mode for data change delta tables.
146+ */
147+ public void setForDataChangeDeltaTable () {
148+ forDataChangeDeltaTable =true ;
149+ }
150+
143151/**
144152 * Create a shallow copy of the result set. The data and a temporary table
145153 * (if there is any) is not copied.
@@ -343,10 +351,14 @@ private void cloneLobs(Value[] values) {
343351for (int i =0 ;i <values .length ;i ++) {
344352Value v =values [i ];
345353if (v instanceof ValueLob ) {
346- ValueLob v2 = ((ValueLob )v ).copyToResult ();
347- if (v2 !=v ) {
354+ if (forDataChangeDeltaTable ) {
348355containsLobs =true ;
349- values [i ] =session .addTemporaryLob (v2 );
356+ }else {
357+ ValueLob v2 = ((ValueLob )v ).copyToResult ();
358+ if (v2 !=v ) {
359+ containsLobs =true ;
360+ values [i ] =session .addTemporaryLob (v2 );
361+ }
350362 }
351363 }
352364 }