[teiid-issues] [JBoss JIRA] (TEIID-5378) NPE when inserting into Global Temporary Table from a function or procedure

Steven Hawkins (JIRA) issues at jboss.org
Fri Jun 15 14:15:00 EDT 2018


     [ https://issues.jboss.org/browse/TEIID-5378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins resolved TEIID-5378.
-----------------------------------
    Fix Version/s: 11.0
                   10.3.2
                   10.2.3
       Resolution: Done


The logic to get the temp table was only using the session store for session level queries - and instead accidentally using the procedure scoped temp store otherwise.  Now we'll use the correct temp store.

> 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
>             Fix For: 11.0, 10.3.2, 10.2.3
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list