Skip to content

Commit 1a5bc4d

Browse files
authored
Fix move table with sequences (#9709)
1 parent 8ec20d4 commit 1a5bc4d

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
@@ -1190,4 +1190,25 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
11901190
TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove");
11911191
env.TestWaitNotification(runtime, txId);
11921192
}
1193+
1194+
Y_UNIT_TEST(MoveTableWithSequence) {
1195+
TTestBasicRuntime runtime;
1196+
TTestEnv env(runtime);
1197+
ui64 txId = 100;
1198+
1199+
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
1200+
TableDescription {
1201+
Name: "Table"
1202+
Columns { Name: "key" Type: "Uint64" DefaultFromSequence: "myseq" }
1203+
Columns { Name: "value" Type: "Uint64" }
1204+
KeyColumnNames: ["key"]
1205+
}
1206+
SequenceDescription {
1207+
Name: "myseq"
1208+
}
1209+
)");
1210+
env.TestWaitNotification(runtime, txId);
1211+
1212+
TestMoveTable(runtime, ++txId, "/MyRoot/Table", "/MyRoot/TableMove", {NKikimrScheme::StatusPreconditionFailed});
1213+
}
11931214
}

0 commit comments

Comments
 (0)