mirror of
https://github.com/actiontech/dble.git
synced 2026-02-14 01:29:01 -06:00
Merge pull request #3301 from actiontech/fix-1787
fix statement insertion errors inner 1787
This commit is contained in:
@@ -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 illegal,the " + 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 illegal,the " + Charset.defaultCharset().name() + " encoding is recommended, Column [ " + name + " ] show be use u4E00-u9FA5a-zA-Z_0-9\\-\\.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user