Author: van.halbert
Date: 2012-12-14 14:36:28 -0500 (Fri, 14 Dec 2012)
New Revision: 4531
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
Log:
TEIID-2063 porting the changes to 7.7.x for next release
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2012-11-13
22:30:23 UTC (rev 4530)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2012-12-14
19:36:28 UTC (rev 4531)
@@ -515,7 +515,7 @@
}
static boolean isProcedure(PlanNode projectNode) {
- if(projectNode.getType() == NodeConstants.Types.PROJECT &&
projectNode.getChildCount() > 0) {
+ if(projectNode != null && projectNode.getType() ==
NodeConstants.Types.PROJECT && projectNode.getChildCount() > 0) {
PlanNode accessNode = projectNode.getFirstChild();
Command command = getNonQueryCommand(accessNode);
return command instanceof StoredProcedure;
Modified:
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
===================================================================
---
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-11-13
22:30:23 UTC (rev 4530)
+++
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-12-14
19:36:28 UTC (rev 4531)
@@ -73,6 +73,21 @@
TestProcessor.helpProcess(plan, dataManager, expected);
}
+ @Test public void testProcTableFunction() throws Exception {
+ String sql = "select param1, param2, e1, e2 from pm1.vsp26 as x,
texttable('abc' columns a string) as y where param1=1 and
param2='a'"; //$NON-NLS-1$
+
+ List<?>[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), "a", "a",
new Integer(3)}), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+
+ ProcessorPlan plan = TestProcessor.helpGetPlan(sql,
RealMetadataFactory.example1Cached());
+
+ TestProcessor.helpProcess(plan, dataManager, expected);
+ }
+
@Test public void testProcInSelectScalarSubquery() throws Exception {
String sql = "select (EXEC pm1.vsp36(pm1.g1.e2)) from pm1.g1 where pm1.g1.e1
= 'a'"; //$NON-NLS-1$
Show replies by date