提交 5678d845 编写于 作者: S serge-rider

Columns data type resolve fix


Former-commit-id: 5a59dc7a
上级 a800d420
......@@ -24,10 +24,7 @@ import org.jkiss.dbeaver.model.data.DBDDataFilter;
import org.jkiss.dbeaver.model.impl.data.formatters.BinaryFormatterHexNative;
import org.jkiss.dbeaver.model.sql.*;
import org.jkiss.dbeaver.model.sql.parser.SQLSemanticProcessor;
import org.jkiss.dbeaver.model.struct.DBSAttributeBase;
import org.jkiss.dbeaver.model.struct.DBSDataType;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.model.struct.*;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedure;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameter;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameterKind;
......@@ -515,7 +512,12 @@ public class BasicSQLDialect implements SQLDialect {
if (column instanceof DBSObject) {
// If type is UDT (i.e. we can find it in type list) and type precision == column precision
// then do not use explicit precision in column definition
final DBSDataType dataType = DBUtils.getLocalDataType(((DBSObject) column).getDataSource(), column.getTypeName());
final DBSDataType dataType;
if (column instanceof DBSTypedObjectEx) {
dataType = ((DBSTypedObjectEx) column).getDataType();
} else {
dataType = DBUtils.getLocalDataType(((DBSObject) column).getDataSource(), column.getTypeName());
}
if (dataType != null && CommonUtils.equalObjects(dataType.getScale(), column.getScale()) &&
((CommonUtils.toInt(dataType.getPrecision()) > 0 && CommonUtils.equalObjects(dataType.getPrecision(), column.getPrecision())) ||
(dataType.getMaxLength() > 0 && dataType.getMaxLength() == column.getMaxLength())))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册