[teiid-commits] teiid SVN: r1014 - in trunk/engine/src: test/java/com/metamatrix/query/sql/visitor and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Jun 1 16:04:34 EDT 2009


Author: shawkins
Date: 2009-06-01 16:04:34 -0400 (Mon, 01 Jun 2009)
New Revision: 1014

Added:
   trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestEvaluatableVisitor.java
Modified:
   trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
Log:
TEIID-641 changing needs evaluation to check nested commands

Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java	2009-05-30 13:02:35 UTC (rev 1013)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java	2009-06-01 20:04:34 UTC (rev 1014)
@@ -37,6 +37,7 @@
 import com.metamatrix.query.sql.lang.StoredProcedure;
 import com.metamatrix.query.sql.lang.SubqueryCompareCriteria;
 import com.metamatrix.query.sql.lang.SubquerySetCriteria;
+import com.metamatrix.query.sql.navigator.DeepPreOrderNavigator;
 import com.metamatrix.query.sql.navigator.PreOrderNavigator;
 import com.metamatrix.query.sql.symbol.AggregateSymbol;
 import com.metamatrix.query.sql.symbol.Constant;
@@ -173,7 +174,7 @@
     
     public static final boolean needsProcessingEvaluation(LanguageObject obj) {
         EvaluatableVisitor visitor = new EvaluatableVisitor();
-        PreOrderNavigator.doVisit(obj, visitor);
+        DeepPreOrderNavigator.doVisit(obj, visitor);
         return visitor.levels.contains(EvaluationLevel.PROCESSING);
     }
 }

Added: trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestEvaluatableVisitor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestEvaluatableVisitor.java	                        (rev 0)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestEvaluatableVisitor.java	2009-06-01 20:04:34 UTC (rev 1014)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.query.sql.visitor;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import com.metamatrix.query.resolver.TestResolver;
+import com.metamatrix.query.sql.lang.Query;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
+
+public class TestEvaluatableVisitor {
+
+	@Test public void testNestedNeedsEvaluation() throws Exception {
+		Query command = (Query)TestResolver.helpResolve("select * from pm1.g1 where e1 in (select e1 from pm1.g2 where e2 = ?)", FakeMetadataFactory.example1Cached(), null); //$NON-NLS-1$
+		assertTrue(EvaluatableVisitor.needsProcessingEvaluation(command));
+	}
+	
+}


Property changes on: trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestEvaluatableVisitor.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the teiid-commits mailing list