Преглед изворни кода

fix(service): 放宽表名校验正则,允许数字开头和连字符

mqy20260511
humanleft пре 2 недеља
родитељ
комит
5c88b90a61

+ 2
- 2
iot-platform/src/main/java/com/iot/platform/service/TdEngineService.java Прегледај датотеку

@@ -35,8 +35,8 @@ public class TdEngineService {
35 35
     // 允许的列名字符(仅 ASCII 字母、数字、下划线)
36 36
     private static final String ALLOWED_COLUMNS = "^[a-zA-Z_][a-zA-Z0-9_]*$";
37 37
 
38
-    // 允许的表名/数据库名字符
39
-    private static final String ALLOWED_TABLE_NAME = "^[a-zA-Z_][a-zA-Z0-9_]*$";
38
+    // 允许的表名/数据库名字符(允许数字开头和连字符,如 UUID 格式的表名)
39
+    private static final String ALLOWED_TABLE_NAME = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$";
40 40
 
41 41
     // TdEngine 超级表最大列数限制
42 42
     private static final int MAX_COLUMNS_PER_STABLE = 4096;

Loading…
Откажи
Сачувај