Skip to content

Fix wrong isolation level for commit in per statement execution #5887

@VPolka

Description

@VPolka

If the last statement in query is ddl, the all query failed with error
[[bad]]assertion failed at ydb/core/kqp/ut/service/kqp_qs_queries_ut.cpp:2301, virtual void NKikimr::NKqp::NTestSuiteKqpQueryService::TTestCaseDdl_Dml::Execute_(NUnitTest::TTestContext &): (result.GetStatus() == EStatus::SUCCESS) failed: (INTERNAL_ERROR != SUCCESS) <main>: Error: ydb/core/kqp/executer_actor/kqp_data_executer.cpp:144 TKqpDataExecuter(): requirement Request.IsolationLevel != NKikimrKqp::ISOLATION_LEVEL_UNDEFINED failed

Unittest example:

            auto result = db.ExecuteQuery(R"(
                CREATE TABLE TestDdlDml2 (
                    Key Uint64,
                    Value1 String,
                    Value2 String,
                    PRIMARY KEY (Key)
                );
                UPSERT INTO TestDdlDml2 (Key, Value1, Value2) VALUES (1, "1", "1");
                SELECT * FROM TestDdlDml2;
                ALTER TABLE TestDdlDml2 DROP COLUMN Value2;
                UPSERT INTO TestDdlDml2 (Key, Value1) VALUES (2, "2");
                SELECT * FROM TestDdlDml2;
                CREATE TABLE TestDdlDml33 (
                    Key Uint64,
                    PRIMARY KEY (Key)
                );
            )", TTxControl::NoTx()).ExtractValueSync();
            UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions