You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Pereslegin (Jira)" <ji...@apache.org> on 2023/11/28 08:41:00 UTC

[jira] [Updated] (IGNITE-20976) Sql. Multistatement dynamic parameters adjusting works incorrect for DELETE operator.

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

Pavel Pereslegin updated IGNITE-20976:
--------------------------------------
    Ignite Flags:   (was: Docs Required,Release Notes Required)

> Sql. Multistatement dynamic parameters adjusting works incorrect for DELETE operator.
> -------------------------------------------------------------------------------------
>
>                 Key: IGNITE-20976
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20976
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> Normalized statement cannot be obtained for 'DELETE' statement with dynamic parameters.
> It seems that after adjusting the dynamic parameters (see {{ScriptParseResult.SqlDynamicParamsAdjuster}},  the new tree cannot be converted to a string.
> Reproducer:
> {code:java}
>     @Test
>     public void testScriptDelete() {
>         String query1 = "SELECT 1;";
>         String query2 = "DELETE FROM TEST WHERE ID=?";
>         // Parse separately - ok.
>         StatementParseResult res1 = IgniteSqlParser.parse(query1, StatementParseResult.MODE);
>         StatementParseResult res2 = IgniteSqlParser.parse(query2, StatementParseResult.MODE);
>         System.out.println(res1.toString());
>         System.out.println(res2.toString());
>         
>         // Parse script throws "UnsupportedOperationException" by `toString()` for `DELETE` statement. 
>         ScriptParseResult scriptRes = IgniteSqlParser.parse(query1 + query2, ScriptParseResult.MODE);
>         for (StatementParseResult res : scriptRes.results()) {
>             System.out.println(res.toString());
>         }
>     }
> {code}



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