@@ -3603,6 +3603,35 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
3603
3603
NLs::IsBackupTable(true),
3604
3604
});
3605
3605
3606
+ // cannot alter backup table
3607
+ TestAlterTable(runtime, ++txId, "/MyRoot", R"(
3608
+ Name: "CopyTable"
3609
+ DropColumns { Name: "value" }
3610
+ )", {NKikimrScheme::StatusSchemeError});
3611
+
3612
+ // cannot add cdc stream to backup table
3613
+ TestCreateCdcStream(runtime, ++txId, "/MyRoot", R"(
3614
+ TableName: "CopyTable"
3615
+ StreamDescription {
3616
+ Name: "Stream"
3617
+ Mode: ECdcStreamModeKeysOnly
3618
+ Format: ECdcStreamFormatProto
3619
+ }
3620
+ )", {NKikimrScheme::StatusSchemeError});
3621
+
3622
+ // cannot add sequence to backup table
3623
+ TestCreateSequence(runtime, ++txId, "/MyRoot/CopyTable", R"(
3624
+ Name: "Sequence"
3625
+ )", {NKikimrScheme::StatusSchemeError});
3626
+
3627
+ // cannot add index to backup table
3628
+ TestBuildIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/CopyTable", "Index", {"value"});
3629
+ env.TestWaitNotification(runtime, txId);
3630
+ {
3631
+ auto desc = TestGetBuildIndex(runtime, TTestTxConfig::SchemeShard, "/MyRoot", txId);
3632
+ UNIT_ASSERT_EQUAL(desc.GetIndexBuild().GetState(), Ydb::Table::IndexBuildState::STATE_REJECTED);
3633
+ }
3634
+
3606
3635
// consistent copy table
3607
3636
TestConsistentCopyTables(runtime, ++txId, "/", R"(
3608
3637
CopyTableDescriptions {
@@ -3741,16 +3770,18 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
3741
3770
)", {NKikimrScheme::StatusInvalidParameter});
3742
3771
3743
3772
// cannot remove 'IsBackup' property from existent table
3744
- TestAlterTable (runtime, ++txId, "/MyRoot", R"(
3773
+ AsyncSend (runtime, TTestTxConfig::SchemeShard, InternalTransaction(AlterTableRequest( ++txId, "/MyRoot", R"(
3745
3774
Name: "CopyTable"
3746
3775
IsBackup: false
3747
- )", {NKikimrScheme::StatusInvalidParameter});
3776
+ )")));
3777
+ TestModificationResults(runtime, txId, {NKikimrScheme::StatusInvalidParameter});
3748
3778
3749
- TestAlterTable (runtime, ++txId, "/MyRoot", R"(
3779
+ AsyncSend (runtime, TTestTxConfig::SchemeShard, InternalTransaction(AlterTableRequest( ++txId, "/MyRoot", R"(
3750
3780
Name: "CopyTable"
3751
3781
IsBackup: false
3752
3782
DropColumns { Name: "value" }
3753
- )", {NKikimrScheme::StatusInvalidParameter});
3783
+ )")));
3784
+ TestModificationResults(runtime, txId, {NKikimrScheme::StatusInvalidParameter});
3754
3785
3755
3786
// sanity check
3756
3787
0 commit comments