@@ -2568,6 +2568,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
25682568
25692569 }
25702570
2571+
25712572 // clear subdomain
25722573 {
25732574 TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
@@ -2585,6 +2586,97 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
25852586 }
25862587 }
25872588
2589+ Y_UNIT_TEST (ColumnSchemeLimitsRejects) {
2590+ TTestBasicRuntime runtime;
2591+ TTestEnv env (runtime);
2592+ ui64 txId = 100 ;
2593+
2594+ TSchemeLimits lowLimits;
2595+ lowLimits.MaxDepth = 4 ;
2596+ lowLimits.MaxPaths = 3 ;
2597+ lowLimits.MaxChildrenInDir = 3 ;
2598+ lowLimits.MaxAclBytesSize = 25 ;
2599+ lowLimits.MaxTableColumns = 3 ;
2600+ lowLimits.MaxColumnTableColumns = 3 ;
2601+ lowLimits.MaxTableColumnNameLength = 10 ;
2602+ lowLimits.MaxTableKeyColumns = 1 ;
2603+ lowLimits.MaxShards = 6 ;
2604+ lowLimits.MaxShardsInPath = 4 ;
2605+ lowLimits.MaxPQPartitions = 20 ;
2606+
2607+
2608+ // lowLimits.ExtraPathSymbolsAllowed = "!\"#$%&'()*+,-.:;<=>?@[\\]^_`{|}~";
2609+ SetSchemeshardSchemaLimits (runtime, lowLimits);
2610+ TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
2611+ {NLs::PathExist,
2612+ NLs::DomainLimitsIs (lowLimits.MaxPaths , lowLimits.MaxShards , lowLimits.MaxPQPartitions )});
2613+
2614+ {
2615+ TestCreateSubDomain (runtime, txId++, " /MyRoot" ,
2616+ " PlanResolution: 50 "
2617+ " Coordinators: 1 "
2618+ " Mediators: 1 "
2619+ " TimeCastBucketsPerMediator: 2 "
2620+ " Name: \" USER_0\" "
2621+ " DatabaseQuotas {"
2622+ " data_stream_shards_quota: 2"
2623+ " data_stream_reserved_storage_quota: 200000"
2624+ " }" );
2625+ }
2626+
2627+ // create column tables, column limits
2628+ {
2629+ TestMkDir (runtime, txId++, " /MyRoot/USER_0" , " C" );
2630+ env.TestWaitNotification (runtime, txId - 1 );
2631+
2632+ // MaxColumnTableColumns
2633+ TestCreateColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2634+ Name: "C2"
2635+ ColumnShardCount: 1
2636+ Schema {
2637+ Columns { Name: "RowId" Type: "Uint64", NotNull: true }
2638+ Columns { Name: "Value0" Type: "Utf8" }
2639+ Columns { Name: "Value1" Type: "Utf8" }
2640+ KeyColumnNames: "RowId"
2641+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2642+ }
2643+ )" , {NKikimrScheme::StatusAccepted});
2644+ env.TestWaitNotification (runtime, txId - 1 );
2645+
2646+ TestAlterColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2647+ Name: "C2"
2648+ AlterSchema {
2649+ DropColumns {Name: "Value0"}
2650+ }
2651+ )" , {NKikimrScheme::StatusAccepted});
2652+ env.TestWaitNotification (runtime, txId - 1 );
2653+
2654+ TestAlterColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2655+ Name: "C2"
2656+ AlterSchema {
2657+ DropColumns {Name: "Value1"}
2658+ AddColumns { Name: "Value2" Type: "Utf8" }
2659+ AddColumns { Name: "Value3" Type: "Utf8" }
2660+ AddColumns { Name: "Value4" Type: "Utf8" }
2661+ }
2662+ )" , {NKikimrScheme::StatusSchemeError});
2663+ env.TestWaitNotification (runtime, txId - 1 );
2664+
2665+ TestCreateColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2666+ Name: "C1"
2667+ ColumnShardCount: 1
2668+ Schema {
2669+ Columns { Name: "RowId" Type: "Uint64", NotNull: true }
2670+ Columns { Name: "Value0" Type: "Utf8" }
2671+ Columns { Name: "Value1" Type: "Utf8" }
2672+ Columns { Name: "Value2" Type: "Utf8" }
2673+ KeyColumnNames: "RowId"
2674+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2675+ }
2676+ )" , {NKikimrScheme::StatusSchemeError});
2677+ }
2678+ }
2679+
25882680 Y_UNIT_TEST (SchemeLimitsRejectsWithIndexedTables) {
25892681 TTestBasicRuntime runtime;
25902682 TTestEnv env (runtime);
0 commit comments