@@ -261,9 +261,24 @@ TEST(ColumnsCase, LowCardinalityString_Save) {
261261}
262262
263263TEST (ColumnsCase, CreateSimpleAggregateFunction) {
264- auto col = CreateColumnByType (" SimpleAggregateFunction(funt, Int32" );
264+ auto col = CreateColumnByType (" SimpleAggregateFunction(funt, Int32) " );
265265
266266 ASSERT_EQ (" Int32" , col->Type ()->GetName ());
267267 ASSERT_EQ (Type::Int32, col->Type ()->GetCode ());
268268 ASSERT_NE (nullptr , col->As <ColumnInt32>());
269269}
270+
271+
272+ TEST (CreateColumnByType, UnmatchedBrackets) {
273+ // When type string has unmatched brackets, CreateColumnByType must return nullptr.
274+ ASSERT_EQ (nullptr , CreateColumnByType (" FixedString(10" ));
275+ ASSERT_EQ (nullptr , CreateColumnByType (" Nullable(FixedString(10000" ));
276+ ASSERT_EQ (nullptr , CreateColumnByType (" Nullable(FixedString(10000)" ));
277+ ASSERT_EQ (nullptr , CreateColumnByType (" LowCardinality(Nullable(FixedString(10000" ));
278+ ASSERT_EQ (nullptr , CreateColumnByType (" LowCardinality(Nullable(FixedString(10000)" ));
279+ ASSERT_EQ (nullptr , CreateColumnByType (" LowCardinality(Nullable(FixedString(10000))" ));
280+ ASSERT_EQ (nullptr , CreateColumnByType (" Array(LowCardinality(Nullable(FixedString(10000" ));
281+ ASSERT_EQ (nullptr , CreateColumnByType (" Array(LowCardinality(Nullable(FixedString(10000)" ));
282+ ASSERT_EQ (nullptr , CreateColumnByType (" Array(LowCardinality(Nullable(FixedString(10000))" ));
283+ ASSERT_EQ (nullptr , CreateColumnByType (" Array(LowCardinality(Nullable(FixedString(10000)))" ));
284+ }
0 commit comments