Author: shawkins
Date: 2011-05-31 14:42:40 -0400 (Tue, 31 May 2011)
New Revision: 3206
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
Log:
TEIID-1528 fix for regression
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2011-05-31
15:50:52 UTC (rev 3205)
+++
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2011-05-31
18:42:40 UTC (rev 3206)
@@ -152,7 +152,7 @@
toCriteria.add(j);
}
}
- List<Criteria> joinCriteria = (List<Criteria>)
joinNode.getProperty(Info.JOIN_CRITERIA);
+ List<Criteria> joinCriteria = (List<Criteria>)
joinNode.getProperty(Info.NON_EQUI_JOIN_CRITERIA);
for (int index : toCriteria) {
SingleElementSymbol lses = leftExpressions.get(index);
SingleElementSymbol rses = rightExpressions.get(index);
@@ -163,7 +163,7 @@
joinNode.setProperty(Info.JOIN_TYPE, JoinType.JOIN_INNER);
}
}
- joinNode.setProperty(Info.JOIN_CRITERIA, joinCriteria);
+ joinNode.setProperty(Info.NON_EQUI_JOIN_CRITERIA, joinCriteria);
leftExpressions = RelationalNode.projectTuple(reorder, leftExpressions);
rightExpressions = RelationalNode.projectTuple(reorder, rightExpressions);
joinNode.setProperty(NodeConstants.Info.LEFT_EXPRESSIONS, leftExpressions);
Modified:
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
===================================================================
---
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2011-05-31
15:50:52 UTC (rev 3205)
+++
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2011-05-31
18:42:40 UTC (rev 3206)
@@ -312,7 +312,10 @@
@Test public void testUnneededMergePredicate() throws Exception {
execute("create local temporary table x (e1 string, e2 integer, primary key
(e1))", new List[] {Arrays.asList(0)}); //$NON-NLS-1$
execute("create local temporary table x1 (e1 string, e2 integer)", new List[]
{Arrays.asList(0)}); //$NON-NLS-1$
- TestOptimizer.helpPlan("select x.e1 from x, x1 where x.e2 = x1.e2 and x.e1 =
x1.e1", this.metadata, new String[] {"SELECT x.e2, x.e1 FROM x ORDER BY
x.e1", "SELECT x1.e2, x1.e1 FROM x1 ORDER BY x1.e1"},
ComparisonMode.EXACT_COMMAND_STRING);
+ TestOptimizer.helpPlan("select x.e1 from x makenotdep, x1 makenotdep where x.e2 =
x1.e2 and x.e1 = x1.e1", this.metadata, new String[] {"SELECT x.e2, x.e1 FROM x
ORDER BY x.e1", "SELECT x1.e2, x1.e1 FROM x1 ORDER BY x1.e1"},
ComparisonMode.EXACT_COMMAND_STRING);
+ execute("insert into x (e2, e1) values (2, 'b')", new List[]
{Arrays.asList(1)}); //$NON-NLS-1$
+ execute("insert into x1 (e2, e1) values (3, 'b')", new List[]
{Arrays.asList(1)}); //$NON-NLS-1$
+ execute("select x.e1 from x makenotdep, x1 makenotdep where x.e2 = x1.e2 and x.e1
= x1.e1", new List[0]); //$NON-NLS-1$
}
private void sampleTable() throws Exception {