Author: shawkins
Date: 2012-01-22 09:57:11 -0500 (Sun, 22 Jan 2012)
New Revision: 3811
Modified:
branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java
branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-1904 fix for expression evaluation error in multi-source planning
Modified:
branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java
===================================================================
---
branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2012-01-21
01:54:31 UTC (rev 3810)
+++
branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2012-01-22
14:57:11 UTC (rev 3811)
@@ -156,11 +156,14 @@
try {
command = QueryRewriter.rewrite(command, metadata, null);
instanceNode.setCommand(command);
+ if (!instanceNode.isShouldEvaluate()) {
+ instanceNode.minimizeProject(command);
+ }
} catch(QueryValidatorException e) {
// ignore and use original command
}
- if (!RelationalNodeUtil.shouldExecute(command, false)) {
+ if (!RelationalNodeUtil.shouldExecute(command, false, true)) {
continue;
}
@@ -271,7 +274,7 @@
DeepPreOrderNavigator.doVisit(command, new
MultiSourceElementReplacementVisitor(sourceName));
}
- if (!RelationalNodeUtil.shouldExecute(command, false)) {
+ if (!RelationalNodeUtil.shouldExecute(command, false, true)) {
return null;
}
Modified:
branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
===================================================================
---
branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2012-01-21
01:54:31 UTC (rev 3810)
+++
branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2012-01-22
14:57:11 UTC (rev 3811)
@@ -40,6 +40,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.QueryOptimizer;
import org.teiid.query.optimizer.TestOptimizer;
+import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.processor.HardcodedDataManager;
@@ -53,6 +54,7 @@
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.util.CommandContext;
+import org.teiid.translator.SourceSystemFunctions;
/**
* It's important here that the MultiSourceCapabilityFinder is used since some
capabilities
@@ -60,6 +62,7 @@
*
* @since 4.2
*/
+@SuppressWarnings("nls")
public class TestMultiSourcePlanToProcessConverter {
private final class MultiSourceDataManager extends HardcodedDataManager {
@@ -83,10 +86,14 @@
}
private static final boolean DEBUG = false;
+
+ public void helpTestMultiSourcePlan(QueryMetadataInterface metadata, String userSql,
String multiModel, int sourceCount, ProcessorDataManager dataMgr, List<?>[]
expectedResults, VDBMetaData vdb) throws Exception {
+ helpTestMultiSourcePlan(metadata, userSql, multiModel, sourceCount, dataMgr,
expectedResults, vdb, null);
+ }
- public void helpTestMultiSourcePlan(QueryMetadataInterface metadata, String userSql,
String multiModel, int sourceCount, ProcessorDataManager dataMgr, List[] expectedResults,
VDBMetaData vdb) throws Exception {
+ public void helpTestMultiSourcePlan(QueryMetadataInterface metadata, String userSql,
String multiModel, int sourceCount, ProcessorDataManager dataMgr, List<?>[]
expectedResults, VDBMetaData vdb, List<?> params) throws Exception {
- DQPWorkContext dqpContext = RealMetadataFactory.buildWorkContext(metadata, vdb);
+ DQPWorkContext dqpContext = RealMetadataFactory.buildWorkContext(metadata, vdb);
Set<String> multiSourceModels = vdb.getMultiSourceModelNames();
for (String model:multiSourceModels) {
@@ -107,7 +114,9 @@
// Plan
command = QueryRewriter.rewrite(command, wrapper, null);
FakeCapabilitiesFinder fakeFinder = new FakeCapabilitiesFinder();
- fakeFinder.addCapabilities(multiModel, TestOptimizer.getTypicalCapabilities());
+ BasicSourceCapabilities bsc = TestOptimizer.getTypicalCapabilities();
+ bsc.setFunctionSupport(SourceSystemFunctions.CONCAT, true);
+ fakeFinder.addCapabilities(multiModel, bsc);
CapabilitiesFinder finder = new MultiSourceCapabilitiesFinder(fakeFinder,
multiSourceModels);
@@ -123,8 +132,10 @@
System.out.println("\nMultiSource Plan:"); //$NON-NLS-1$
System.out.println(plan);
}
-
- TestProcessor.helpProcess(plan, context, dataMgr, expectedResults);
+ if (params != null) {
+ TestProcessor.setParameterValues(params, command, context);
+ }
+ TestProcessor.helpProcess(plan, context, dataMgr, expectedResults);
}
@Test public void testNoReplacement() throws Exception {
@@ -132,7 +143,7 @@
final String userSql = "SELECT * FROM MultiModel.Phys WHERE SOURCE_NAME =
'bogus'"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 2;
- final List[] expected =
+ final List<?>[] expected =
new List[0];
final ProcessorDataManager dataMgr = new MultiSourceDataManager();
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
@@ -143,22 +154,34 @@
final String userSql = "SELECT * FROM MultiModel.Phys WHERE SOURCE_NAME =
'a'"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 2;
- final List[] expected =
- new List[] { Arrays.asList(new Object[] { null, null, null}) };
+ final List<?>[] expected =
+ new List<?>[] { Arrays.asList(new Object[] { null, null,
"a"}) };
final HardcodedDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(false);
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
+ @Test public void testPreparedReplacement() throws Exception {
+ final QueryMetadataInterface metadata =
RealMetadataFactory.exampleMultiBinding();
+ final String userSql = "SELECT * FROM MultiModel.Phys WHERE SOURCE_NAME =
?"; //$NON-NLS-1$
+ final String multiModel = "MultiModel"; //$NON-NLS-1$
+ final int sources = 2;
+ final List<?>[] expected =
+ new List<?>[] { Arrays.asList(new Object[] { null, null,
"a"}) };
+ final HardcodedDataManager dataMgr = new MultiSourceDataManager();
+ dataMgr.setMustRegisterCommands(false);
+ helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB(), Arrays.asList("a"));
+ }
+
@Test public void testMultiReplacement() throws Exception {
final QueryMetadataInterface metadata =
RealMetadataFactory.exampleMultiBinding();
final String userSql = "SELECT * FROM MultiModel.Phys"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected =
- new List[] { Arrays.asList(new Object[] { null, null, null}),
- Arrays.asList(new Object[] { null, null, null}),
- Arrays.asList(new Object[] { null, null, null})};
+ final List<?>[] expected =
+ new List<?>[] { Arrays.asList(new Object[] { null, null,
"a"}),
+ Arrays.asList(new Object[] { null, null, "b"}),
+ Arrays.asList(new Object[] { null, null, "c"})};
final ProcessorDataManager dataMgr = new MultiSourceDataManager();
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -166,44 +189,44 @@
@Test public void testMultiReplacementWithOrderBy() throws Exception {
QueryMetadataInterface metadata = RealMetadataFactory.exampleMultiBinding();
- final String userSql = "SELECT * FROM MultiModel.Phys order by a";
//$NON-NLS-1$
+ final String userSql = "SELECT a, b, source_name || a FROM MultiModel.Phys
order by a"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 2;
- final List[] expected = new List[] {
- Arrays.asList("e", "z", "b"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("f", "z", "b"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("x", "z", "a"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("y", "z", "a"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ final List<?>[] expected = new List<?>[] {
+ Arrays.asList("e", "z", "be"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("f", "z", "bf"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("x", "z", "ax"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("y", "z", "ay"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
};
final HardcodedDataManager dataMgr = new HardcodedDataManager();
- dataMgr.addData("SELECT g_0.a, g_0.b, 'a' FROM MultiModel.Phys AS
g_0", //$NON-NLS-1$
- new List[] {
- Arrays.asList("y", "z", "a"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("x", "z", "a")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- dataMgr.addData("SELECT g_0.a, g_0.b, 'b' FROM MultiModel.Phys AS
g_0", //$NON-NLS-1$
- new List[] {
- Arrays.asList("e", "z", "b"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("f", "z", "b")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('a', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {
+ Arrays.asList("y", "z", "ay"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("x", "z",
"ax")}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('b', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {
+ Arrays.asList("e", "z", "be"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("f", "z",
"bf")}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@Test public void testMultiReplacementWithLimit() throws Exception {
final QueryMetadataInterface metadata =
RealMetadataFactory.exampleMultiBinding();
- final String userSql = "SELECT distinct * FROM MultiModel.Phys order by a
limit 1"; //$NON-NLS-1$
+ final String userSql = "SELECT distinct a, b, source_name || a FROM
MultiModel.Phys order by a limit 1"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 2;
- final List[] expected = new List[] {
- Arrays.asList("e", "z", "b"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ final List<?>[] expected = new List<?>[] {
+ Arrays.asList("e", "z", "be"), //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
};
final HardcodedDataManager dataMgr = new HardcodedDataManager();
- dataMgr.addData("SELECT g_0.a, g_0.b, 'a' FROM MultiModel.Phys AS
g_0", //$NON-NLS-1$
- new List[] {
- Arrays.asList("y", "z", "a"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("x", "z", "a")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- dataMgr.addData("SELECT g_0.a, g_0.b, 'b' FROM MultiModel.Phys AS
g_0", //$NON-NLS-1$
- new List[] {
- Arrays.asList("e", "z", "b"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Arrays.asList("f", "z", "b")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('a', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {
+ Arrays.asList("y", "z", "ay"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("x", "z", "ax")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('b', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {
+ Arrays.asList("e", "z", "be"),
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Arrays.asList("f", "z", "bf")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -213,8 +236,8 @@
final String userSql = "SELECT a.a FROM MultiModel.Phys a inner join
MultiModel.Phys b makedep on (a.a = b.a) order by a"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 2;
- final List[] expected =
- new List[] { Arrays.asList(new Object[] { "x"}), //$NON-NLS-1$
+ final List<?>[] expected =
+ new List<?>[] { Arrays.asList(new Object[] { "x"}),
//$NON-NLS-1$
Arrays.asList(new Object[] { "x"}), //$NON-NLS-1$
Arrays.asList(new Object[] { "x"}), //$NON-NLS-1$
Arrays.asList(new Object[] { "x"}), //$NON-NLS-1$
@@ -225,10 +248,10 @@
final HardcodedDataManager dataMgr = new HardcodedDataManager();
dataMgr.addData("SELECT g_0.a FROM MultiModel.Phys AS g_0",
//$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { "x" }),
//$NON-NLS-1$
+ new List<?>[] { Arrays.asList(new Object[] { "x"
}), //$NON-NLS-1$
Arrays.asList(new Object[] { "y" })});
//$NON-NLS-1$
dataMgr.addData("SELECT g_0.a FROM MultiModel.Phys AS g_0 WHERE g_0.a IN
('x', 'y')", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { "x" }),
//$NON-NLS-1$
+ new List<?>[] { Arrays.asList(new Object[] { "x"
}), //$NON-NLS-1$
Arrays.asList(new Object[] { "y" })});
//$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -238,7 +261,7 @@
final String userSql = "exec Virt.sq1('a')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(new Object[] { null, null}),
};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(new Object[]
{ null, null}), };
final ProcessorDataManager dataMgr = new MultiSourceDataManager();
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -248,7 +271,7 @@
final String userSql = "exec Virt.sq1(null)"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[0];
+ final List<?>[] expected = new List[0];
final ProcessorDataManager dataMgr = new MultiSourceDataManager();
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -258,10 +281,10 @@
final String userSql = "update MultiModel.Phys set a = '1' where b =
'z'"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(3)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(3)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
- dataMgr.addData("UPDATE MultiModel.Phys SET a = '1' WHERE b =
'z'", new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ dataMgr.addData("UPDATE MultiModel.Phys SET a = '1' WHERE b =
'z'", new List<?>[] {Arrays.asList(1)}); //$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -270,10 +293,10 @@
final String userSql = "INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES
('a', 'a')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(1)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(1)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
- dataMgr.addData("INSERT INTO MultiModel.Phys (a) VALUES ('a')",
new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ dataMgr.addData("INSERT INTO MultiModel.Phys (a) VALUES ('a')",
new List<?>[] {Arrays.asList(1)}); //$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -282,7 +305,7 @@
final String userSql = "INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES
('a', 'x')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(0)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(0)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
@@ -293,10 +316,10 @@
final String userSql = "INSERT INTO MultiModel.Phys(a) VALUES
('a')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(3)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(3)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
- dataMgr.addData("INSERT INTO MultiModel.Phys (a) VALUES ('a')",
new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ dataMgr.addData("INSERT INTO MultiModel.Phys (a) VALUES ('a')",
new List<?>[] {Arrays.asList(1)}); //$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -305,10 +328,10 @@
final String userSql = "exec MultiModel.proc('b',
'a')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(1)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(1)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
- dataMgr.addData("EXEC MultiModel.proc('b')", new List[]
{Arrays.asList(1)}); //$NON-NLS-1$
+ dataMgr.addData("EXEC MultiModel.proc('b')", new
List<?>[] {Arrays.asList(1)}); //$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
@@ -317,10 +340,10 @@
final String userSql = "exec
MultiModel.proc(\"in\"=>'b')"; //$NON-NLS-1$
final String multiModel = "MultiModel"; //$NON-NLS-1$
final int sources = 3;
- final List[] expected = new List[] { Arrays.asList(1), Arrays.asList(1),
Arrays.asList(1)};
+ final List<?>[] expected = new List<?>[] { Arrays.asList(1),
Arrays.asList(1), Arrays.asList(1)};
final MultiSourceDataManager dataMgr = new MultiSourceDataManager();
dataMgr.setMustRegisterCommands(true);
- dataMgr.addData("EXEC MultiModel.proc('b')", new List[]
{Arrays.asList(1)}); //$NON-NLS-1$
+ dataMgr.addData("EXEC MultiModel.proc('b')", new
List<?>[] {Arrays.asList(1)}); //$NON-NLS-1$
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
Modified:
branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
---
branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-01-21
01:54:31 UTC (rev 3810)
+++
branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-01-22
14:57:11 UTC (rev 3811)
@@ -5208,14 +5208,19 @@
ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
// Collect reference, set value
- VariableContext vc = new VariableContext();
+ setParameterValues(values, command, context);
+ // Run query
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ public static void setParameterValues(List<?> values, Command command,
+ CommandContext context) {
+ VariableContext vc = new VariableContext();
Iterator<?> valIter = values.iterator();
for (Reference ref : ReferenceCollectorVisitor.getReferences(command)) {
vc.setGlobalValue(ref.getContextSymbol(), valIter.next()); //$NON-NLS-1$
}
context.setVariableContext(vc);
- // Run query
- helpProcess(plan, context, dataManager, expected);
}
/** defect 15348