Skip to content

Commit 84b4690

Browse files
authored
Fix move table with sequences (ydb-platform#10388)
1 parent cda9edf commit 84b4690

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ydb/core/tx/schemeshard/schemeshard__operation_move_tables.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ TVector<ISubOperation::TPtr> CreateConsistentMoveTable(TOperationId nextId, cons
6565
return {CreateReject(nextId, NKikimrScheme::StatusPreconditionFailed, "Cannot move table with cdc streams")};
6666
}
6767

68+
if (srcChildPath.IsSequence()) {
69+
return {CreateReject(nextId, NKikimrScheme::StatusPreconditionFailed, "Cannot move table with sequences")};
70+
}
71+
6872
TPath dstIndexPath = dstPath.Child(name);
6973

7074
Y_ABORT_UNLESS(srcChildPath.Base()->PathId == child.second);

ydb/core/tx/schemeshard/ut_move/ut_move.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,4 +1191,25 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
11911191
TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove");
11921192
env.TestWaitNotification(runtime, txId);
11931193
}
1194+
1195+
Y_UNIT_TEST(MoveTableWithSequence) {
1196+
TTestBasicRuntime runtime;
1197+
TTestEnv env(runtime);
1198+
ui64 txId = 100;
1199+
1200+
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
1201+
TableDescription {
1202+
Name: "Table"
1203+
Columns { Name: "key" Type: "Uint64" DefaultFromSequence: "myseq" }
1204+
Columns { Name: "value" Type: "Uint64" }
1205+
KeyColumnNames: ["key"]
1206+
}
1207+
SequenceDescription {
1208+
Name: "myseq"
1209+
}
1210+
)");
1211+
env.TestWaitNotification(runtime, txId);
1212+
1213+
TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove", {NKikimrScheme::StatusPreconditionFailed});
1214+
}
11941215
}

0 commit comments

Comments
 (0)