Skip to content

Commit

Permalink
SYMMETRICDS-591
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Mar 26, 2012
1 parent f5fd1aa commit 3281ff2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Expand Up @@ -323,8 +323,8 @@ public List compareColumns(Table sourceTable, Column sourceColumn, Table targetT
.getTypeCode()));
}

boolean sizeMatters = platformInfo.hasSize(sourceColumn.getTypeCode());
boolean scaleMatters = platformInfo.hasPrecisionAndScale(sourceColumn.getTypeCode());
boolean sizeMatters = platformInfo.hasSize(targetColumn.getTypeCode());
boolean scaleMatters = platformInfo.hasPrecisionAndScale(targetColumn.getTypeCode());

String targetSize = targetColumn.getSize();
if (targetSize == null) {
Expand Down Expand Up @@ -363,8 +363,10 @@ public List compareColumns(Table sourceTable, Column sourceColumn, Table targetT
Object sourceDefaultValue = sourceColumn.getParsedDefaultValue();
Object targetDefaultValue = targetColumn.getParsedDefaultValue();

if (((sourceDefaultValue == null) && (targetDefaultValue != null))
|| ((sourceDefaultValue != null) && !sourceDefaultValue.equals(targetDefaultValue))) {
if ((sourceDefaultValue == null && targetDefaultValue != null)
|| (sourceDefaultValue != null && targetDefaultValue == null)
|| (sourceDefaultValue != null && targetDefaultValue != null && !sourceDefaultValue
.toString().equals(targetDefaultValue.toString()))) {
if (log.isDebugEnabled()) {
log.debug("The " + sourceColumn.getName() + " column on the "
+ sourceTable.getName() + " table changed default value from "
Expand Down
Expand Up @@ -154,11 +154,6 @@ protected Column readColumn(DatabaseMetaDataWrapper metaData, Map<String, Object
// Note that the JDBC driver returns DECIMAL for these NUMBER
// columns
switch (column.getSizeAsInt()) {
case 3:
if (column.getScale() == 0) {
column.setTypeCode(Types.TINYINT);
}
break;
case 5:
if (column.getScale() == 0) {
column.setTypeCode(Types.SMALLINT);
Expand Down
Expand Up @@ -70,7 +70,7 @@ public OraclePlatform(DataSource dataSource, DatabasePlatformSettings settings)
info.addNativeTypeMapping(Types.ARRAY, "BLOB", Types.BLOB);
info.addNativeTypeMapping(Types.BIGINT, "NUMBER(38)");
info.addNativeTypeMapping(Types.BINARY, "RAW", Types.VARBINARY);
info.addNativeTypeMapping(Types.BIT, "NUMBER(1)");
info.addNativeTypeMapping(Types.BIT, "NUMBER(1)", Types.DECIMAL);
info.addNativeTypeMapping(Types.DATE, "DATE", Types.TIMESTAMP);
info.addNativeTypeMapping(Types.DECIMAL, "NUMBER");
info.addNativeTypeMapping(Types.DISTINCT, "BLOB", Types.BLOB);
Expand All @@ -88,7 +88,7 @@ public OraclePlatform(DataSource dataSource, DatabasePlatformSettings settings)
info.addNativeTypeMapping(Types.STRUCT, "BLOB", Types.BLOB);
info.addNativeTypeMapping(Types.TIME, "DATE", Types.DATE);
info.addNativeTypeMapping(Types.TIMESTAMP, "TIMESTAMP");
info.addNativeTypeMapping(Types.TINYINT, "NUMBER(3)");
info.addNativeTypeMapping(Types.TINYINT, "NUMBER(3)", Types.DECIMAL);
info.addNativeTypeMapping(Types.VARBINARY, "RAW");
info.addNativeTypeMapping(Types.VARCHAR, "VARCHAR2");

Expand Down

0 comments on commit 3281ff2

Please sign in to comment.