]
Work on TEIID-5378 started by Steven Hawkins.
---------------------------------------------
NPE when inserting into Global Temporary Table from a function or
procedure
---------------------------------------------------------------------------
Key: TEIID-5378
URL:
https://issues.jboss.org/browse/TEIID-5378
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.12.14.6_4
Reporter: Jan Stastny
Assignee: Steven Hawkins
Priority: Critical
For following vdb:
{code:xml}
<vdb name="a" version="1">
<model name="vm1" type="VIRTUAL">
<metadata type="DDL"><![CDATA[
CREATE GLOBAL TEMPORARY TABLE teiidtemp(val integer) OPTIONS (UPDATABLE
'TRUE');
CREATE VIRTUAL FUNCTION f1() RETURNS string AS
BEGIN
INSERT INTO teiidtemp(val) VALUES (1);
DECLARE string v1 = SELECT 'default'||COUNT(val) FROM teiidtemp;
RETURN v1;
END;
CREATE VIRTUAL PROCEDURE p1() RETURNS (v1 string) AS
BEGIN
INSERT INTO teiidtemp(val) VALUES (1);
SELECT 'default'||COUNT(val) FROM teiidtemp;
END;
]]>
</metadata>
</model>
</vdb>
{code}
The following errors occur when invoking procedure or function:
# {code:sql}SELECT f1(){code}
#* 15:49:17,608 WARN [org.teiid.PROCESSOR] (Worker1_QueryProcessorQueue14) TEIID30020
Processing exception for request 3rGTFUcDmmRP.0 'TEIID30328 Unable to evaluate f1():
TEIID30167 java.lang.NullPointerException'. Originally ExpressionEvaluationException
TempTableDataManager.java:227. Enable more detailed logging to see the entire stacktrace.
# {code:sql}SELECT a.v1 FROM (CALL p1()) a{code}
#* 15:49:59,581 WARN [org.teiid.PROCESSOR] (Worker1_QueryProcessorQueue15) TEIID30020
Processing exception for request 3rGTFUcDmmRP.1 'TEIID30167
java.lang.NullPointerException'. Originally ProcedureErrorInstructionException
TempTableDataManager.java:227. Enable more detailed logging to see the entire stacktrace.