@@ -17,8 +17,9 @@ Y_UNIT_TEST_SUITE(NamingValidation) {
17
17
NYdb::TKikimrWithGrpcAndRootSchema server (GetAppConfig ());
18
18
Tests::TClient annoyingClient (*server.ServerSettings );
19
19
20
- TString tableName = " test" ;
21
- TString tableDescr = R"(
20
+ TString allowedChars = " _-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
21
+
22
+ TString tableDescr = Sprintf (R"(
22
23
Name: "TestTable"
23
24
Schema {
24
25
Columns {
@@ -27,12 +28,12 @@ Y_UNIT_TEST_SUITE(NamingValidation) {
27
28
NotNull: True
28
29
}
29
30
Columns {
30
- Name: "message "
31
+ Name: "%s "
31
32
Type: "Utf8"
32
33
}
33
34
KeyColumnNames: ["Id"]
34
35
}
35
- )" ;
36
+ )" , allowedChars. c_str ()) ;
36
37
37
38
NMsgBusProxy::EResponseStatus status = annoyingClient.CreateColumnTable (" /Root" , tableDescr);
38
39
@@ -43,25 +44,29 @@ Y_UNIT_TEST_SUITE(NamingValidation) {
43
44
NYdb::TKikimrWithGrpcAndRootSchema server (GetAppConfig ());
44
45
Tests::TClient annoyingClient (*server.ServerSettings );
45
46
46
- TString tableDescr = R"(
47
- Name: "TestTable"
48
- Schema {
49
- Columns {
50
- Name: "Id"
51
- Type: "Int32"
52
- NotNull: True
53
- }
54
- Columns {
55
- Name: "mess age"
56
- Type: "Utf8"
57
- }
58
- KeyColumnNames: ["Id"]
59
- }
60
- )" ;
61
-
62
- NMsgBusProxy::EResponseStatus status = annoyingClient.CreateColumnTable (" /Root" , tableDescr);
47
+ TVector<TString> notAllowedNames = {" mess age" , " ~!@#$%^&*()+=asdfa" };
63
48
64
- UNIT_ASSERT_VALUES_EQUAL (status, NMsgBusProxy::EResponseStatus::MSTATUS_ERROR);
49
+ for (const auto & colName: notAllowedNames) {
50
+ TString tableDescr = Sprintf (R"(
51
+ Name: "TestTable"
52
+ Schema {
53
+ Columns {
54
+ Name: "Id"
55
+ Type: "Int32"
56
+ NotNull: True
57
+ }
58
+ Columns {
59
+ Name: "%s"
60
+ Type: "Utf8"
61
+ }
62
+ KeyColumnNames: ["Id"]
63
+ }
64
+ )" , colName.c_str ());
65
+
66
+ NMsgBusProxy::EResponseStatus status = annoyingClient.CreateColumnTable (" /Root" , tableDescr);
67
+
68
+ UNIT_ASSERT_VALUES_EQUAL (status, NMsgBusProxy::EResponseStatus::MSTATUS_ERROR);
69
+ }
65
70
}
66
71
67
72
Y_UNIT_TEST (CreateColumnStoreOk) {
@@ -116,7 +121,6 @@ Y_UNIT_TEST_SUITE(NamingValidation) {
116
121
NYdb::TKikimrWithGrpcAndRootSchema server (GetAppConfig ());
117
122
Tests::TClient annoyingClient (*server.ServerSettings );
118
123
119
- TString tableName = " test" ;
120
124
TString tableDescr = R"(
121
125
Name: "TestTable"
122
126
Schema {
@@ -154,7 +158,6 @@ Y_UNIT_TEST_SUITE(NamingValidation) {
154
158
NYdb::TKikimrWithGrpcAndRootSchema server (GetAppConfig ());
155
159
Tests::TClient annoyingClient (*server.ServerSettings );
156
160
157
- TString tableName = " test" ;
158
161
TString tableDescr = R"(
159
162
Name: "TestTable"
160
163
Schema {
0 commit comments