@@ -1605,29 +1605,7 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
16051605
16061606 FillTable (session);
16071607
1608- kikimr.GetTestServer ().GetRuntime ()->GetAppData ().AdministrationAllowedSIDs .push_back (" root@builtin" );
1609-
1610- { // without token request is forbidded
1611- Tests::TClient& client = kikimr.GetTestClient ();
1612- const TString scheme = R"(
1613- Name: "indexImplTable"
1614- PartitionConfig {
1615- PartitioningPolicy {
1616- MinPartitionsCount: 1
1617- SizeToSplit: 100500
1618- FastSplitSettings {
1619- SizeThreshold: 100500
1620- RowCountThreshold: 100500
1621- }
1622- }
1623- }
1624- )" ;
1625- auto result = client.AlterTable (" /Root/MultiShardIndexed/index" , scheme, " user@builtin" );
1626- UNIT_ASSERT_VALUES_EQUAL_C (result->Record .GetStatus (), NMsgBusProxy::MSTATUS_ERROR, " User must not be able to alter index impl table" );
1627- UNIT_ASSERT_VALUES_EQUAL (result->Record .GetErrorReason (), " Administrative access denied" );
1628- }
1629-
1630- { // with root token request is accepted
1608+ { // regular users should be able to alter indexImplTable's PartitionConfig
16311609 Tests::TClient& client = kikimr.GetTestClient ();
16321610 const TString scheme = R"(
16331611 Name: "indexImplTable"
@@ -1642,53 +1620,24 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
16421620 }
16431621 }
16441622 )" ;
1645- auto result = client.AlterTable (" /Root/MultiShardIndexed/index" , scheme, " root@builtin" );
1646- UNIT_ASSERT_VALUES_EQUAL_C (result->Record .GetStatus (), NMsgBusProxy::MSTATUS_OK, " Super user must be able to alter partition config" );
1623+ auto result = client.AlterTable (" /Root/MultiShardIndexed/index" , scheme, {});
1624+ UNIT_ASSERT_VALUES_EQUAL_C (result->Record .GetStatus (), NMsgBusProxy::MSTATUS_OK,
1625+ result->Record .ShortDebugString ()
1626+ );
16471627 }
16481628
1649- { // after alter yql works fine
1650- const TString query ( R"(
1629+ { // yql works fine after alter
1630+ const TString query = R"(
16511631 SELECT * FROM `/Root/MultiShardIndexed` VIEW index ORDER BY fk DESC LIMIT 1;
1652- )" ) ;
1632+ )" ;
16531633
16541634 auto result = session.ExecuteDataQuery (
1655- query,
1656- TTxControl::BeginTx (TTxSettings::SerializableRW ()).CommitTx () )
1657- .ExtractValueSync ();
1635+ query,
1636+ TTxControl::BeginTx (TTxSettings::SerializableRW ()).CommitTx ()
1637+ ) .ExtractValueSync ();
16581638 UNIT_ASSERT_C (result.IsSuccess (), result.GetIssues ().ToString ());
16591639 UNIT_ASSERT_VALUES_EQUAL (NYdb::FormatResultSetYson (result.GetResultSet (0 )), " [[[4294967295u];[4u];[\" v4\" ]]]" );
16601640 }
1661-
1662- FillTable (session);
1663-
1664- { // just for sure, public api got error when alter index
1665- auto settings = NYdb::NTable::TAlterTableSettings ()
1666- .BeginAlterPartitioningSettings ()
1667- .SetPartitionSizeMb (50 )
1668- .SetMinPartitionsCount (4 )
1669- .SetMaxPartitionsCount (5 )
1670- .EndAlterPartitioningSettings ();
1671-
1672- auto result = session.AlterTable (" /Root/MultiShardIndexed/index/indexImplTable" , settings).ExtractValueSync ();
1673- UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SCHEME_ERROR, result.GetIssues ().ToString ());
1674- }
1675-
1676- { // however public api is able to perform alter index if user has AlterSchema right and user is a member of the list AdministrationAllowedSIDs
1677- auto clSettings = NYdb::NTable::TClientSettings ().AuthToken (" root@builtin" ).UseQueryCache (false );
1678- auto client = NYdb::NTable::TTableClient (kikimr.GetDriver (), clSettings);
1679- auto session = client.CreateSession ().GetValueSync ().GetSession ();
1680-
1681- auto settings = NYdb::NTable::TAlterTableSettings ()
1682- .BeginAlterPartitioningSettings ()
1683- .SetPartitionSizeMb (50 )
1684- .SetMinPartitionsCount (4 )
1685- .SetMaxPartitionsCount (5 )
1686- .EndAlterPartitioningSettings ();
1687-
1688- auto result = session.AlterTable (" /Root/MultiShardIndexed/index/indexImplTable" , settings).ExtractValueSync ();
1689- UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
1690- }
1691-
16921641 }
16931642
16941643 Y_UNIT_TEST_TWIN (DataColumnUpsertMixedSemantic, StreamLookup) {
0 commit comments