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 Tupitsyn (Jira)" <ji...@apache.org> on 2023/04/10 08:12:00 UTC

[jira] [Updated] (IGNITE-19262) Sql. DDL silently ignores transaction

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

Pavel Tupitsyn updated IGNITE-19262:
------------------------------------
    Description: 
In *ItSqlSynchronousApiTest*, update *checkDdl*:

{code:java}
    private static void checkDdl(boolean expectedApplied, Session ses, String sql) {
        Transaction tx = CLUSTER_NODES.get(0).transactions().begin();
        ResultSet res = ses.execute(
                tx,
                sql
        );

        assertEquals(expectedApplied, res.wasApplied());
        assertFalse(res.hasRowSet());
        assertEquals(-1, res.affectedRows());

        res.close();
        tx.rollback();
    }
{code}

All tests pass, even though we call rollback. 

DDL does not support transactions. We should throw an exception when *tx* is not null with a DDL statement to make this clear to the users.

> Sql. DDL silently ignores transaction
> -------------------------------------
>
>                 Key: IGNITE-19262
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19262
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0.0-beta1
>            Reporter: Pavel Tupitsyn
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>
> In *ItSqlSynchronousApiTest*, update *checkDdl*:
> {code:java}
>     private static void checkDdl(boolean expectedApplied, Session ses, String sql) {
>         Transaction tx = CLUSTER_NODES.get(0).transactions().begin();
>         ResultSet res = ses.execute(
>                 tx,
>                 sql
>         );
>         assertEquals(expectedApplied, res.wasApplied());
>         assertFalse(res.hasRowSet());
>         assertEquals(-1, res.affectedRows());
>         res.close();
>         tx.rollback();
>     }
> {code}
> All tests pass, even though we call rollback. 
> DDL does not support transactions. We should throw an exception when *tx* is not null with a DDL statement to make this clear to the users.



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