[
https://issues.jboss.org/browse/TEIID-3198?page=com.atlassian.jira.plugin...
]
Steven Hawkins updated TEIID-3198:
----------------------------------
Fix Version/s: 8.9
Affects Version/s: 8.7
Workaround Description: Use WITHOUT RETURN on the execute immediate statement.
Workaround: Workaround Exists
Component/s: Query Engine
NPE on running an "execute immediate" command defined in a
virtual procedure (Teiid-8.9.0-CR2)
----------------------------------------------------------------------------------------------
Key: TEIID-3198
URL:
https://issues.jboss.org/browse/TEIID-3198
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.7
Reporter: Salvatore R
Assignee: Steven Hawkins
Fix For: 8.9
I defined a virtual procedure in the VDB using the following definition:
{code:sql}
<model visible = "true" type = "VIRTUAL" name =
"test_procs">
<metadata type = "DDL"><![CDATA[
create virtual procedure p1(a long) returns (res long) as
begin
execute immediate 'insert into pg.xyz select
''a''';
end;
]]>
</metadata>
</model>
{code}
When I call the virtual procedure:
{code:sql}exec test_procs.p1(1);{code}
I get the following NPE:
{code:sql}
12:56:59,868 ERROR [org.teiid.PROCESSOR] (Worker4_QueryProcessorQueue37) sAgKanG+4e4X
TEIID30019 Unexpected exception for request sAgKanG+4e4X.0: java.lang.NullPointerException
at
org.teiid.query.optimizer.relational.rules.RuleAssignOutputElements.filterVirtualElements(RuleAssignOutputElements.java:477)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.optimizer.relational.rules.RuleAssignOutputElements.assignOutputElements(RuleAssignOutputElements.java:238)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.optimizer.relational.rules.RuleAssignOutputElements.assignOutputElements(RuleAssignOutputElements.java:292)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.optimizer.relational.rules.RuleAssignOutputElements.execute(RuleAssignOutputElements.java:117)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:739)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:221)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:159)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.proc.ExecDynamicSqlInstruction.process(ExecDynamicSqlInstruction.java:186)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.proc.ProcedurePlan.processProcedure(ProcedurePlan.java:379)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.proc.ProcedurePlan.nextBatchDirect(ProcedurePlan.java:288)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at org.teiid.query.processor.proc.ProcedurePlan.nextBatch(ProcedurePlan.java:262)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.relational.PlanExecutionNode.nextBatchDirect(PlanExecutionNode.java:118)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.relational.ProjectNode.nextBatchDirect(ProjectNode.java:146)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:136)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:449)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:331)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:259)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
[teiid-engine-8.9.0.CR2.jar:8.9.0.CR2]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_51]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
{code}
As a workaround, if I use the clause "WITHOUT RETURN" in the execute immediate
command, the procedure is correctly executed:
{code:sql}
<model visible = "true" type = "VIRTUAL" name =
"test_procs">
<metadata type = "DDL"><![CDATA[
create virtual procedure p1(a long) returns (res long) as
begin
execute immediate 'insert into pg.xyz select
''a''' WITHOUT RETURN;
end;
]]>
</metadata>
</model>
{code}
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)