[teiid-commits] teiid SVN: r4547 - in branches/7.7.x/engine/src: test/java/org/teiid/query/processor and 1 other directory.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Thu Jan 31 14:54:35 EST 2013
Author: jolee
Date: 2013-01-31 14:54:35 -0500 (Thu, 31 Jan 2013)
New Revision: 4547
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SourceState.java
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
Log:
TEIID-2363: correcting an issue with nested table joins
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SourceState.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SourceState.java 2013-01-30 17:30:23 UTC (rev 4546)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SourceState.java 2013-01-31 19:54:35 UTC (rev 4547)
@@ -176,6 +176,9 @@
* There are unfortunately quite a few cases to cover here.
*/
protected void prefetch(boolean limit) throws TeiidComponentException, TeiidProcessingException {
+ if (!open) {
+ return;
+ }
if (this.prefetch == null) {
if (this.buffer != null) {
return;
Modified: branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java 2013-01-30 17:30:23 UTC (rev 4546)
+++ branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java 2013-01-31 19:54:35 UTC (rev 4547)
@@ -300,6 +300,22 @@
assertTrue(!(join.getJoinStrategy() instanceof NestedTableJoinStrategy));
helpProcess(plan, createCommandContext(), dataManager, expected);
}
+
+ @Test public void testTextTableJoinPrefetch() throws Exception {
+ String sql = "select z.* from (select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x) as z";
+
+ List[] expected = new List[] {
+ Arrays.asList("c"),
+ Arrays.asList("1"),
+ Arrays.asList("true"),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ dataManager.setBlockOnce();
+ sampleData1(dataManager);
+ RelationalPlan plan = (RelationalPlan)helpGetPlan(helpParse(sql), RealMetadataFactory.example1Cached());
+ helpProcess(plan, createCommandContext(), dataManager, expected);
+ }
@Test public void testTextTableJoin1() throws Exception {
String sql = "select e1, e2 from texttable('a' COLUMNS col string) x, pm1.g1 where col = e1";
More information about the teiid-commits
mailing list