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

Empty XmlElement throws an NPE when passed for the non-nullable parameter

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 10.0.1
    • Fix Version/s: 10.1, 9.3.6, 10.0.2
    • Component/s: Query Engine
    • Labels:
      None
    • Environment:

      teiid-10.0.1 on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)

    • Steps to Reproduce:
      Hide

      1. create the following proc:

          <model visible = "true" type = "VIRTUAL" name = "views">
              <metadata type = "DDL"><![CDATA[
                create virtual procedure v0(IN soapBody xml not null) 
                   returns (response xml) as
                begin
                   select XmlElement(root, 'Hi!');
                end
              ]]>
              </metadata>
          </model>
      

      2. when running the following query:

      call views.v0(
          soapBody => XmlElement(root)
      );;
      

      teiid throws out the following stacktrace:

      2017-12-27 17:19:12,864 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue5) l9O5D2rjxOO3 TEIID30019 Unexpected exception for request l9O5D2rjxOO3.0: java.lang.NullPointerExcep
      tion
              at org.teiid.query.function.source.XMLSystemFunctions.xmlElement(XMLSystemFunctions.java:500)
              at org.teiid.query.eval.Evaluator.evaluateXMLElement(Evaluator.java:1130)
              at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:769)
              at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
              at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:151)
              at org.teiid.query.validator.ValidationVisitor.visit(ValidationVisitor.java:341)
              at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.preVisitVisitor(PreOrPostOrderNavigator.java:51)
              at org.teiid.query.validator.Validator$1.preVisitVisitor(Validator.java:80)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:358)
              at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202)
              at org.teiid.query.validator.Validator.executeValidation(Validator.java:90)
              at org.teiid.query.validator.Validator.validate(Validator.java:44)
              at org.teiid.dqp.internal.process.Request.validateWithVisitor(Request.java:338)
              at org.teiid.dqp.internal.process.Request.validateQuery(Request.java:290)
              at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:434)
              at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
              at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
              at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
              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:280)
              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:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      Show
      1. create the following proc: < model visible = "true" type = "VIRTUAL" name = "views" > < metadata type = "DDL" > <![CDATA[ create virtual procedure v0(IN soapBody xml not null) returns (response xml) as begin select XmlElement(root, 'Hi!'); end ]]> </ metadata > </ model > 2. when running the following query: call views.v0( soapBody => XmlElement(root) );; teiid throws out the following stacktrace: 2017-12-27 17:19:12,864 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue5) l9O5D2rjxOO3 TEIID30019 Unexpected exception for request l9O5D2rjxOO3.0: java.lang.NullPointerExcep tion at org.teiid.query.function.source.XMLSystemFunctions.xmlElement(XMLSystemFunctions.java:500) at org.teiid.query.eval.Evaluator.evaluateXMLElement(Evaluator.java:1130) at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:769) at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707) at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:151) at org.teiid.query.validator.ValidationVisitor.visit(ValidationVisitor.java:341) at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202) at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50) at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.preVisitVisitor(PreOrPostOrderNavigator.java:51) at org.teiid.query.validator.Validator$1.preVisitVisitor(Validator.java:80) at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:358) at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202) at org.teiid.query.validator.Validator.executeValidation(Validator.java:90) at org.teiid.query.validator.Validator.validate(Validator.java:44) at org.teiid.dqp.internal.process.Request.validateWithVisitor(Request.java:338) at org.teiid.dqp.internal.process.Request.validateQuery(Request.java:290) at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:434) at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486) at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660) at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339) 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:280) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

      Description

      Empty XmlElement throws an NPE when passed for the non-nullable parameter.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                dalex005 dalex dalex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: