@@ -3074,6 +3074,43 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
30743074 Y_UNIT_TEST_TWIN (DeleteAbsentMultipleShards, Reboot) {
30753075 TestDeleteAbsent (2 , Reboot);
30763076 }
3077+
3078+ Y_UNIT_TEST (InsertEmptyString) {
3079+ NKikimrConfig::TAppConfig appConfig;
3080+ appConfig.MutableColumnShardConfig ()->SetAllowNullableColumnsInPK (true );
3081+ auto settings = TKikimrSettings ().SetAppConfig (appConfig).SetWithSampleTables (false );
3082+ TTestHelper testHelper (settings);
3083+
3084+ TVector<TTestHelper::TColumnSchema> schema = {
3085+ TTestHelper::TColumnSchema ().SetName (" id" ).SetType (NScheme::NTypeIds::Int64).SetNullable (false ),
3086+ TTestHelper::TColumnSchema ().SetName (" value" ).SetType (NScheme::NTypeIds::String).SetNullable (false ),
3087+ };
3088+ TTestHelper::TColumnTable testTable;
3089+ testTable.SetName (" /Root/ttt" ).SetPrimaryKey ({ " id" , }).SetSharding ({ " id" }).SetSchema (schema);
3090+ testHelper.CreateTable (testTable);
3091+ auto client = testHelper.GetKikimr ().GetQueryClient ();
3092+ const auto result = client
3093+ .ExecuteQuery (
3094+ R"(
3095+ INSERT INTO `/Root/ttt` (id, value) VALUES
3096+ (347, '')
3097+ )" ,
3098+ NYdb::NQuery::TTxControl::BeginTx ().CommitTx ())
3099+ .GetValueSync ();
3100+ UNIT_ASSERT_C (result.IsSuccess (), result.GetIssues ().ToString ());
3101+ {
3102+ const auto resultSelect = client
3103+ .ExecuteQuery (
3104+ " SELECT * FROM `/Root/ttt`" ,
3105+ NYdb::NQuery::TTxControl::BeginTx ().CommitTx ())
3106+ .GetValueSync ();
3107+ UNIT_ASSERT_C (resultSelect.IsSuccess (), resultSelect.GetIssues ().ToString ());
3108+ const auto resultSets = resultSelect.GetResultSets ();
3109+ UNIT_ASSERT_VALUES_EQUAL (resultSets.size (), 1 );
3110+ const auto resultSet = resultSets[0 ];
3111+ UNIT_ASSERT_VALUES_EQUAL (resultSet.RowsCount (), 1 );
3112+ }
3113+ }
30773114}
30783115
30793116}
0 commit comments