Skip to content
Open
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 @@ -35,7 +35,7 @@ public class FeNameFormat {
// please modify error msg when FeNameFormat.checkCommonName throw exception in CreateRoutineLoadStmt
private static final String COMMON_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$";
private static final String UNDERSCORE_COMMON_NAME_REGEX = "^[_a-zA-Z][a-zA-Z0-9\\-_]{0,63}$";
private static final String TABLE_NAME_REGEX = "^[a-zA-Z0-9\\-_$]*$";
private static final String TABLE_NAME_REGEX = "^[a-zA-Z0-9\\-_]*$";
private static final String USER_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9.\\-_]*$";
private static final String REPOSITORY_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9\\-_]{0,255}$";
private static final String COLUMN_NAME_REGEX
Expand All @@ -44,7 +44,7 @@ public class FeNameFormat {
private static final String UNICODE_LABEL_REGEX = "^[\\-_A-Za-z0-9:\\p{L}]{1," + Config.label_regex_length + "}$";
private static final String UNICODE_COMMON_NAME_REGEX = "^[a-zA-Z\\p{L}][a-zA-Z0-9\\-_\\p{L}]{0,63}$";
private static final String UNICODE_UNDERSCORE_COMMON_NAME_REGEX = "^[_a-zA-Z\\p{L}][a-zA-Z0-9\\-_\\p{L}]{0,63}$";
private static final String UNICODE_TABLE_NAME_REGEX = "^[\\s\\S]*[\\S]$";
private static final String UNICODE_TABLE_NAME_REGEX = "^(?!.*\\$)[\\s\\S]*[\\S]$";
private static final String UNICODE_USER_NAME_REGEX = "^[a-zA-Z\\p{L}][a-zA-Z0-9.\\-_\\p{L}]*$";
private static final String UNICODE_COLUMN_NAME_REGEX
= "^[\\s\\S]{0,255}[\\S]$";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void testTableName() {
"a_1", // Underscore + number
"B2", // Uppercase letter + number
"1abc", // Starts with digit
"abc$", // Contains invalid symbol $
"-abc", // Starts with hyphen
"_abc" // Starts with underscore
);
Expand All @@ -98,7 +97,8 @@ void testTableName() {
"", // Empty string
"x ", // space character as last one
"x\t", // table character as last one
"x\n" // enter character as last one
"x\n", // enter character as last one
"abc$" // Contains invalid symbol $
);

List<String> unicodeValid = Lists.newArrayList(
Expand Down
13 changes: 13 additions & 0 deletions regression-test/suites/ddl_p0/test_create_table.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ suite("sql_create_time_range_table") {
exception "Disable to create table"
}

test {
sql """
CREATE TABLE tbl\$refs (
k1 int,
k2 int
)
DUPLICATE KEY (`k1`)
DISTRIBUTED BY HASH(`k2`) BUCKETS 1
PROPERTIES ("replication_num" = "1");
"""
exception "Incorrect table name"
}

// DDL/DML return 1 row and 1 column, the only value is update row count
assertTrue(result1.size() == 1)
assertTrue(result1[0].size() == 1)
Expand Down