Ver código fonte

better import/copy column setup; added ability for users to further customize import/copy behavior through ImportFilter (fix #1593465)


git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@135 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/rel_1_1_8
James Ahlborn 17 anos atrás
pai
commit
aca6f8632e

+ 8
- 11
src/java/com/healthmarketscience/jackcess/DataType.java Ver arquivo

@@ -290,17 +290,14 @@ public enum DataType {
throw new SQLException("Unsupported SQL type: " + sqlType);
}

if(rtn.isVariableLength()) {
// make sure size is reasonable
if((lengthInUnits * rtn.getUnitSize()) > rtn.getMaxSize()) {
// try alternate types
DataType altRtn = ALT_SQL_TYPES.get(sqlType);
if(altRtn != null) {
if((lengthInUnits * altRtn.getUnitSize()) <= altRtn.getMaxSize()) {
// use alternate type
rtn = altRtn;
}
}
// make sure size is reasonable
int size = lengthInUnits * rtn.getUnitSize();
if(rtn.isVariableLength() && !rtn.isValidSize(size)) {
// try alternate type
DataType altRtn = ALT_SQL_TYPES.get(sqlType);
if((altRtn != null) && altRtn.isValidSize(size)) {
// use alternate type
rtn = altRtn;
}
}

Carregando…
Cancelar
Salvar