Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-23317

Sql. ExecutionContext::get / Execution::getParameter return null if dynamic parameter does not exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      Methods of `ExecutionContext` that return values dynamic parameters, such as get and getParameter, return null when dynamic parameter does not exist.

      Add validation to these methods so they won't return null for not existing dynamic parameters.

      Reproducer:

       @Test
          public void div()  {
              TestCluster testCluster= TestBuilders.cluster().nodes("N1").build();
              testCluster.start();
      
              TestNode node = testCluster.node("N1");
              QueryPlan plan = node.prepare("SELECT ?/0", 1);
        
              List<InternalSqlRow> allFromCursor = CursorUtils.getAllFromCursor(node.executePlan(plan));
              // Returns null but should throw Division by zero
              // because TestNode::executePlan does not pass dynamic parameters.
              for (var row : allFromCursor) {
                  System.err.println(row.get(0));
              }
          }
      

      P.S.
      Update TestNode::executePlan to support passing dynamic parameters.

      Attachments

        Issue Links

          Activity

            People

              xtern Pavel Pereslegin
              mzhuravkov Maksim Zhuravkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h