Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FeNameFormat {
private static final String LABEL_REGEX = "^[-_A-Za-z0-9]{1,128}$";
private static final String COMMON_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9_]{0,63}$";
private static final String COMMON_TABLE_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9_]*$";
private static final String COLUMN_NAME_REGEX = "^[_a-zA-Z@][a-zA-Z0-9_]{0,63}$";
private static final String COLUMN_NAME_REGEX = "^[_a-zA-Z@0-9][a-zA-Z0-9_]{0,255}$";

public static final String FORBIDDEN_PARTITION_NAME = "placeholder_";

Expand Down
84 changes: 84 additions & 0 deletions regression-test/suites/ddl_p0/test_fnf.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("test_fnf") {
try {
sql """
CREATE TABLE IF NOT EXISTS `test_fnf` (
`test_varchar` varchar(1) NULL,
`0test_varchar` varchar(1) NULL,
`@test_varchar` varchar(1) NULL,
`_test_varchar` varchar(1) NULL,
`_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_var` varchar(1) NULL,
`@test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_var` varchar(1) NULL,
`0test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_var` varchar(1) NULL
) ENGINE=OLAP
UNIQUE KEY(`test_varchar`)
DISTRIBUTED BY HASH(`test_varchar`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
)
"""
} catch (java.sql.SQLException t){
assertTrue(false)
}

try {
sql """
CREATE TABLE IF NOT EXISTS `test_fnf_error_1` (
`test@_varchar` varchar(1) NULL
) ENGINE=OLAP
UNIQUE KEY(`test_varchar`)
DISTRIBUTED BY HASH(`test_varchar`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
)
"""
} catch (java.sql.SQLException t){
assertTrue(true)
}

try {
sql """
CREATE TABLE IF NOT EXISTS `test_fnf_error_2` (
`test_varchar` varchar(1) NULL,
`_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varchar_test_varc` varchar(1) NULL
) ENGINE=OLAP
UNIQUE KEY(`test_varchar`)
DISTRIBUTED BY HASH(`test_varchar`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
)
"""
} catch (java.sql.SQLException t){
assertTrue(true)
} finally {
sql """ DROP TABLE IF EXISTS test_fnf """

sql """ DROP TABLE IF EXISTS test_fnf_error_1 """

sql """ DROP TABLE IF EXISTS test_fnf_error_2 """
}

}