Merge pull request #3301 from actiontech/fix-1787

fix statement insertion errors inner 1787
This commit is contained in:
ylinzhu
2022-07-07 16:38:12 +08:00
committed by GitHub

View File

@@ -549,21 +549,21 @@ public class DbleDbInstance extends ManagerWritableTable {
}
private void checkChineseProperty(String val, String name) {
if (StringUtil.isBlank(val)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value not be null or empty");
}
int length = 11;
if (val.length() > length) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value contains a maximum of " + length + " characters");
}
String chinese = val.replaceAll(DBConverter.PATTERN_DB.toString(), "");
if (Strings.isNullOrEmpty(chinese)) {
return;
}
if (!StringUtil.isChinese(chinese)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegalthe " + Charset.defaultCharset().name() + " encoding is recommended, Column [ " + name + " ] show be use u4E00-u9FA5a-zA-Z_0-9\\-\\.");
if (Objects.nonNull(val)) {
if (StringUtil.isBlank(val)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value not be null or empty");
}
int length = 11;
if (val.length() > length) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value contains a maximum of " + length + " characters");
}
String chinese = val.replaceAll(DBConverter.PATTERN_DB.toString(), "");
if (Strings.isNullOrEmpty(chinese)) {
return;
}
if (!StringUtil.isChinese(chinese)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegalthe " + Charset.defaultCharset().name() + " encoding is recommended, Column [ " + name + " ] show be use u4E00-u9FA5a-zA-Z_0-9\\-\\.");
}
}
}
}