Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5378

NPE when inserting into Global Temporary Table from a function or procedure

    Details

      Description

      For following vdb:

      <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>
      

      The following errors occur when invoking procedure or function:

      1. SELECT f1()
        • 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.
      2. SELECT a.v1 FROM (CALL p1()) a
        • 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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                jstastny Jan Stastny
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: