@@ -3122,6 +3122,44 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
31223122 )" , FormatResultSetYson (resultSet));
31233123 }
31243124 }
3125+
3126+ Y_UNIT_TEST (InsertEmptyString) {
3127+ NKikimrConfig::TAppConfig appConfig;
3128+ appConfig.MutableColumnShardConfig ()->SetAllowNullableColumnsInPK (true );
3129+ auto settings = TKikimrSettings ().SetAppConfig (appConfig).SetWithSampleTables (false );
3130+ TTestHelper testHelper (settings);
3131+
3132+ TVector<TTestHelper::TColumnSchema> schema = {
3133+ TTestHelper::TColumnSchema ().SetName (" id" ).SetType (NScheme::NTypeIds::Int64).SetNullable (false ),
3134+ TTestHelper::TColumnSchema ().SetName (" value" ).SetType (NScheme::NTypeIds::String).SetNullable (false ),
3135+ };
3136+ TTestHelper::TColumnTable testTable;
3137+ testTable.SetName (" /Root/ttt" ).SetPrimaryKey ({ " id" , }).SetSharding ({ " id" }).SetSchema (schema);
3138+ testHelper.CreateTable (testTable);
3139+ auto client = testHelper.GetKikimr ().GetQueryClient ();
3140+ const auto result = client
3141+ .ExecuteQuery (
3142+ R"(
3143+ INSERT INTO `/Root/ttt` (id, value) VALUES
3144+ (347, '')
3145+ )" ,
3146+ NYdb::NQuery::TTxControl::BeginTx ().CommitTx ())
3147+ .GetValueSync ();
3148+ UNIT_ASSERT_C (result.IsSuccess (), result.GetIssues ().ToString ());
3149+ {
3150+ const auto resultSelect = client
3151+ .ExecuteQuery (
3152+ " SELECT * FROM `/Root/ttt`" ,
3153+ NYdb::NQuery::TTxControl::BeginTx ().CommitTx ())
3154+ .GetValueSync ();
3155+ UNIT_ASSERT_C (resultSelect.IsSuccess (), resultSelect.GetIssues ().ToString ());
3156+ const auto resultSets = resultSelect.GetResultSets ();
3157+ UNIT_ASSERT_VALUES_EQUAL (resultSets.size (), 1 );
3158+ const auto resultSet = resultSets[0 ];
3159+ UNIT_ASSERT_VALUES_EQUAL (resultSet.RowsCount (), 1 );
3160+ }
3161+ }
3162+
31253163}
31263164
31273165}
0 commit comments