Skip to content

Commit 82750b6

Browse files
authored
Merge 430eeee into 21bdc0e
2 parents 21bdc0e + 430eeee commit 82750b6

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

ydb/core/kqp/session_actor/kqp_query_state.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,10 @@ class TKqpQueryState : public TNonCopyable {
504504
}
505505
}
506506

507+
void PrepareCommitStatementsTransaction() {
508+
TxCtx->EffectiveIsolationLevel = NKikimrKqp::ISOLATION_LEVEL_SERIALIZABLE;
509+
}
510+
507511
// validate the compiled query response and ensure that all table versions are not
508512
// changed since the last compilation.
509513
bool EnsureTableVersions(const TEvTxProxySchemeCache::TEvNavigateKeySetResult& response);

ydb/core/kqp/session_actor/kqp_session_actor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,9 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
11801180
ProcessExecuterResult(response.get());
11811181
return true;
11821182
} else if (commit) {
1183+
if (QueryState->HasImplicitTx() && !QueryState->Commited) {
1184+
QueryState->PrepareCommitStatementsTransaction();
1185+
}
11831186
QueryState->Commited = true;
11841187

11851188
for (const auto& effect : txCtx.DeferredEffects) {

ydb/core/kqp/ut/service/kqp_qs_queries_ut.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,6 +2313,10 @@ Y_UNIT_TEST_SUITE(KqpQueryService) {
23132313
ALTER TABLE TestDdlDml2 DROP COLUMN Value2;
23142314
UPSERT INTO TestDdlDml2 (Key, Value1) VALUES (2, "2");
23152315
SELECT * FROM TestDdlDml2;
2316+
CREATE TABLE TestDdlDml33 (
2317+
Key Uint64,
2318+
PRIMARY KEY (Key)
2319+
);
23162320
)", TTxControl::NoTx()).ExtractValueSync();
23172321
UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
23182322
UNIT_ASSERT_VALUES_EQUAL(result.GetResultSets().size(), 2);

0 commit comments

Comments
 (0)