remove length

This commit is contained in:
Looly
2022-03-17 20:53:36 +08:00
parent c500c43890
commit b0605b55ba
3 changed files with 22 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package cn.hutool.db.meta;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.db.DbRuntimeException;
import java.io.Serializable;
@@ -111,7 +112,12 @@ public class Column implements Serializable, Cloneable {
this.isPk = table.isPk(this.name);
this.type = columnMetaRs.getInt("DATA_TYPE");
this.typeName = columnMetaRs.getString("TYPE_NAME");
String typeName = columnMetaRs.getString("TYPE_NAME");
//issue#2201@Gitee
typeName = ReUtil.delLast("\\(\\d+\\)", typeName);
this.typeName = typeName;
this.size = columnMetaRs.getInt("COLUMN_SIZE");
this.isNullable = columnMetaRs.getBoolean("NULLABLE");
this.comment = columnMetaRs.getString("REMARKS");