diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_move_tables.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_move_tables.cpp index 32dadccbd563..9a7da1e828fb 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_move_tables.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_move_tables.cpp @@ -65,6 +65,10 @@ TVector CreateConsistentMoveTable(TOperationId nextId, cons return {CreateReject(nextId, NKikimrScheme::StatusPreconditionFailed, "Cannot move table with cdc streams")}; } + if (srcChildPath.IsSequence()) { + return {CreateReject(nextId, NKikimrScheme::StatusPreconditionFailed, "Cannot move table with sequences")}; + } + TPath dstIndexPath = dstPath.Child(name); Y_ABORT_UNLESS(srcChildPath.Base()->PathId == child.second); diff --git a/ydb/core/tx/schemeshard/ut_move/ut_move.cpp b/ydb/core/tx/schemeshard/ut_move/ut_move.cpp index 7690dd906a7e..1c9e7391798f 100644 --- a/ydb/core/tx/schemeshard/ut_move/ut_move.cpp +++ b/ydb/core/tx/schemeshard/ut_move/ut_move.cpp @@ -1191,4 +1191,25 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) { TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove"); env.TestWaitNotification(runtime, txId); } + + Y_UNIT_TEST(MoveTableWithSequence) { + TTestBasicRuntime runtime; + TTestEnv env(runtime); + ui64 txId = 100; + + TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"( + TableDescription { + Name: "Table" + Columns { Name: "key" Type: "Uint64" DefaultFromSequence: "myseq" } + Columns { Name: "value" Type: "Uint64" } + KeyColumnNames: ["key"] + } + SequenceDescription { + Name: "myseq" + } + )"); + env.TestWaitNotification(runtime, txId); + + TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove", {NKikimrScheme::StatusPreconditionFailed}); + } }