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

Catching exception in the LOOP results in assertion error, if exception is thrown by procedural call

    Details

    • Steps to Reproduce:
      Hide

      1. Deploy *-vdb.xml declaring following procedure

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <vdb name="ProcVDB" version="1">
       
          <description>ProcVDB</description>
        
      <model visible = "true" type = "VIRTUAL" name = "pr">
              <metadata type = "DDL"><![CDATA[
              
      	create virtual procedure pr() as
      begin
      	error 'a';
      end ;;        
      ]]>
              </metadata>
          </model>
      </vdb>
      

      2. Execute query in SQuirrel

      BEGIN
          LOOP ON (SELECT 1 union all select 2) AS market
          BEGIN
              CALL pr.pr();
              EXCEPTION e
          END
      END ;;
      

      3. Query fails with the stack trace
      12:01:41,128 ERROR [org.teiid.PROCESSOR] (Worker9_QueryProcessorQueue62) 9qA/iFk+7uCp TEIID30019 Unexpected exception for request 9qA/iFk+7uCp.16: java.lang.AssertionError: Assertion failed.
      at org.teiid.core.util.Assertion.failed(Assertion.java:69)
      at org.teiid.core.util.Assertion.assertTrue(Assertion.java:64)
      at org.teiid.core.util.Assertion.assertTrue(Assertion.java:56)
      at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:137)
      at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)
      at org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:65)
      at org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:66)
      at org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:80)
      at org.teiid.common.buffer.AbstractTupleSource.hasNext(AbstractTupleSource.java:88)
      at org.teiid.query.processor.proc.ProcedurePlan.executePlan(ProcedurePlan.java:612)
      at org.teiid.query.processor.proc.CreateCursorResultSetInstruction.process(CreateCursorResultSetInstruction.java:65)
      at org.teiid.query.processor.proc.ProcedurePlan.processProcedure(ProcedurePlan.java:389)
      at org.teiid.query.processor.proc.ProcedurePlan.nextBatchDirect(ProcedurePlan.java:297)
      at org.teiid.query.processor.proc.ProcedurePlan.nextBatch(ProcedurePlan.java:269)
      at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:148)
      at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)
      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160)
      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142)
      at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:480)
      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:350)
      at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
      at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

      Show
      1. Deploy *-vdb.xml declaring following procedure <?xml version= "1.0" encoding= "UTF-8" standalone= "yes" ?> <vdb name= "ProcVDB" version= "1" > <description> ProcVDB </description> <model visible = "true" type = "VIRTUAL" name = "pr" > <metadata type = "DDL" > <![CDATA[ create virtual procedure pr() as begin error 'a' ; end ;; ]]> </metadata> </model> </vdb> 2. Execute query in SQuirrel BEGIN LOOP ON ( SELECT 1 union all select 2) AS market BEGIN CALL pr.pr(); EXCEPTION e END END ;; 3. Query fails with the stack trace 12:01:41,128 ERROR [org.teiid.PROCESSOR] (Worker9_QueryProcessorQueue62) 9qA/iFk+7uCp TEIID30019 Unexpected exception for request 9qA/iFk+7uCp.16: java.lang.AssertionError: Assertion failed. at org.teiid.core.util.Assertion.failed(Assertion.java:69) at org.teiid.core.util.Assertion.assertTrue(Assertion.java:64) at org.teiid.core.util.Assertion.assertTrue(Assertion.java:56) at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:137) at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111) at org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:65) at org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:66) at org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:80) at org.teiid.common.buffer.AbstractTupleSource.hasNext(AbstractTupleSource.java:88) at org.teiid.query.processor.proc.ProcedurePlan.executePlan(ProcedurePlan.java:612) at org.teiid.query.processor.proc.CreateCursorResultSetInstruction.process(CreateCursorResultSetInstruction.java:65) at org.teiid.query.processor.proc.ProcedurePlan.processProcedure(ProcedurePlan.java:389) at org.teiid.query.processor.proc.ProcedurePlan.nextBatchDirect(ProcedurePlan.java:297) at org.teiid.query.processor.proc.ProcedurePlan.nextBatch(ProcedurePlan.java:269) at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:148) at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111) at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160) at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142) at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:480) at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:350) at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47) at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276) at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277) at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115) at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

      Description

      Loop Query fails with AssertionError in the stacktrace when exception is thrown by procedural call

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                isemenov Ivan Semenov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: