[ 
https://issues.apache.org/jira/browse/IGNITE-23317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-23317:
--------------------------------------
    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:

{code:java}
 @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));
        }
    }
{code}

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



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

{code:java}
 @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
        for (var row : allFromCursor) {
            System.err.println(row.get(0));
        }
    }
{code}

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




> Sql. ExecutionContext::get / Execution::getParameter return null if dynamic 
> parameter does not exist
> ----------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-23317
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23317
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>
> 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:
> {code:java}
>  @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));
>         }
>     }
> {code}
> P.S.
> Update TestNode::executePlan to support passing dynamic parameters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to