提交 2766f532 编写于 作者: S serge-rider

#3311 Generic column read workaround (Clickhouse bug).


Former-commit-id: 0e04ee30
上级 4bf6e290
......@@ -139,12 +139,22 @@ public class TableCache extends JDBCStructLookupCache<GenericStructContainer, Ge
String typeName = GenericUtils.safeGetStringTrimmed(columnObject, dbResult, JDBCConstants.TYPE_NAME);
long columnSize = GenericUtils.safeGetLong(columnObject, dbResult, JDBCConstants.COLUMN_SIZE);
boolean isNotNull = GenericUtils.safeGetInt(columnObject, dbResult, JDBCConstants.NULLABLE) == DatabaseMetaData.columnNoNulls;
Integer scale = GenericUtils.safeGetInteger(columnObject, dbResult, JDBCConstants.DECIMAL_DIGITS);
Integer scale = null;
try {
scale = GenericUtils.safeGetInteger(columnObject, dbResult, JDBCConstants.DECIMAL_DIGITS);
} catch (Throwable e) {
log.warn("Error getting column scale", e);
}
Integer precision = null;
if (valueType == Types.NUMERIC || valueType == Types.DECIMAL) {
precision = (int) columnSize;
}
int radix = GenericUtils.safeGetInt(columnObject, dbResult, JDBCConstants.NUM_PREC_RADIX);
int radix = 10;
try {
radix = GenericUtils.safeGetInt(columnObject, dbResult, JDBCConstants.NUM_PREC_RADIX);
} catch (Exception e) {
log.warn("Error getting column radix", e);
}
String defaultValue = GenericUtils.safeGetString(columnObject, dbResult, JDBCConstants.COLUMN_DEF);
String remarks = GenericUtils.safeGetString(columnObject, dbResult, JDBCConstants.REMARKS);
long charLength = GenericUtils.safeGetLong(columnObject, dbResult, JDBCConstants.CHAR_OCTET_LENGTH);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册