diff options
author | Ilnaz Nizametdinov <i.nizametdinov@gmail.com> | 2022-04-21 01:44:04 +0300 |
---|---|---|
committer | Ilnaz Nizametdinov <i.nizametdinov@gmail.com> | 2022-04-21 01:44:04 +0300 |
commit | 32fa7c1907ac5606c0acead620b8103121e95290 (patch) | |
tree | c5e8415224d2f99e2003ff43998ea0100e86f8ad | |
parent | 79ec9004ef29380d2184890d4ba7851d5848d90c (diff) | |
download | ydb-32fa7c1907ac5606c0acead620b8103121e95290.tar.gz |
CopyTable() test KIKIMR-13698
ref:969228e9cf4150d94c6f67e8572424bf572b88c8
-rw-r--r-- | ydb/core/tx/schemeshard/ut_cdc_stream.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp index aedf7a458ec..703aa384fe4 100644 --- a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp +++ b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp @@ -397,4 +397,46 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) { TestDropPQGroup(runtime, ++txId, "/MyRoot/Table/Stream", "streamImpl", {NKikimrScheme::StatusNameConflict}); } + Y_UNIT_TEST(CopyTableShouldNotCopyStream) { + TTestBasicRuntime runtime; + TTestEnv env(runtime, TTestEnvOptions().EnableProtoSourceIdInfo(true)); + ui64 txId = 100; + + TestCreateTable(runtime, ++txId, "/MyRoot", R"( + Name: "Table" + Columns { Name: "key" Type: "Uint64" } + Columns { Name: "value" Type: "Uint64" } + KeyColumnNames: ["key"] + )"); + env.TestWaitNotification(runtime, txId); + + TestCreateCdcStream(runtime, ++txId, "/MyRoot", R"( + TableName: "Table" + StreamDescription { + Name: "Stream" + Mode: ECdcStreamModeKeysOnly + Format: ECdcStreamFormatProto + } + )"); + env.TestWaitNotification(runtime, txId); + + TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/Table/Stream"), {NLs::PathExist}); + TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/Table/Stream/streamImpl"), {NLs::PathExist}); + + TestCopyTable(runtime, ++txId, "/MyRoot", "TableCopy", "/MyRoot/Table"); + env.TestWaitNotification(runtime, txId); + + TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/TableCopy/Stream"), {NLs::PathNotExist}); + + TestConsistentCopyTables(runtime, ++txId, "/", R"( + CopyTableDescriptions { + SrcPath: "/MyRoot/Table" + DstPath: "/MyRoot/TableConsistentCopy" + } + )"); + env.TestWaitNotification(runtime, txId); + + TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/TableCopy/Stream"), {NLs::PathNotExist}); + } + } // TCdcStreamTests |