Author: shawkins
Date: 2009-09-21 15:37:01 -0400 (Mon, 21 Sep 2009)
New Revision: 1429
Modified:
branches/6.2.x/engine/src/main/java/com/metamatrix/query/processor/relational/BatchedUpdateNode.java
branches/6.2.x/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java
Log:
TEIID-843 fix for indexoutofbounds exception.
Modified:
branches/6.2.x/engine/src/main/java/com/metamatrix/query/processor/relational/BatchedUpdateNode.java
===================================================================
---
branches/6.2.x/engine/src/main/java/com/metamatrix/query/processor/relational/BatchedUpdateNode.java 2009-09-21
17:29:59 UTC (rev 1428)
+++
branches/6.2.x/engine/src/main/java/com/metamatrix/query/processor/relational/BatchedUpdateNode.java 2009-09-21
19:37:01 UTC (rev 1429)
@@ -90,7 +90,7 @@
for (int i = 0; i < updateCommands.size(); i++) {
Command updateCommand = (Command)updateCommands.get(i).clone();
CommandContext context = this.getContext();
- if (this.contexts != null) {
+ if (this.contexts != null && !this.contexts.isEmpty()) {
context = (CommandContext)context.clone();
context.setVariableContext(this.contexts.get(i));
}
Modified:
branches/6.2.x/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java
===================================================================
---
branches/6.2.x/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java 2009-09-21
17:29:59 UTC (rev 1428)
+++
branches/6.2.x/engine/src/test/java/com/metamatrix/query/processor/relational/TestBatchedUpdateNode.java 2009-09-21
19:37:01 UTC (rev 1429)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.junit.Test;
@@ -57,7 +58,7 @@
for (Command command : commands) {
shouldEvaluate.add(EvaluatableVisitor.needsProcessingEvaluation(command));
}
- BatchedUpdateNode node = new BatchedUpdateNode(1, commands, null, shouldEvaluate,
"myModelName"); //$NON-NLS-1$
+ BatchedUpdateNode node = new BatchedUpdateNode(1, commands,
Collections.EMPTY_LIST, shouldEvaluate, "myModelName"); //$NON-NLS-1$
CommandContext context = new CommandContext();
context.setProcessorID("myProcessorID"); //$NON-NLS-1$
node.initialize(context, Mockito.mock(BufferManager.class), pdm);
Show replies by date