Author: jolee
Date: 2012-04-04 15:49:13 -0400 (Wed, 04 Apr 2012)
New Revision: 3971
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
Log:
TEIID-1899 fixing assertion error during join
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-04-04
02:29:57 UTC (rev 3970)
+++
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-04-04
19:49:13 UTC (rev 3971)
@@ -82,6 +82,7 @@
private DependentValueSource dvs;
private List<SetState> dependentSetStates = new
LinkedList<SetState>();
private String valueSource;
+ private DependentValueSource originalVs;
public TupleState(String source) {
this.valueSource = source;
@@ -90,7 +91,7 @@
public void sort() throws BlockedException,
TeiidComponentException, TeiidProcessingException {
if (dvs == null) {
- DependentValueSource originalVs =
(DependentValueSource)dependentNode.getContext().getVariableContext().getGlobalValue(valueSource);
+ originalVs =
(DependentValueSource)dependentNode.getContext().getVariableContext().getGlobalValue(valueSource);
if (!originalVs.isDistinct()) {
if (sortUtility == null) {
List<Expression> sortSymbols = new
ArrayList<Expression>(dependentSetStates.size());
@@ -130,7 +131,9 @@
public void close() {
if (dvs != null) {
sortUtility = null;
- dvs.getTupleBuffer().remove();
+ if (dvs != originalVs) {
+ dvs.getTupleBuffer().remove();
+ }
dvs = null;
}
}
@@ -364,6 +367,11 @@
}
hasNextCommand = !restartIndexes.isEmpty();
+ if (hasNextCommand && dependentState.size() > 1) {
+ for (TupleState state : dependentState.values()) {
+ state.originalVs.setUnused(true);
+ }
+ }
}
protected boolean hasNextCommand() {
Show replies by thread