db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r382175 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
Date Wed, 01 Mar 2006 22:15:27 GMT
Author: tomdz
Date: Wed Mar  1 14:15:24 2006
New Revision: 382175

URL: http://svn.apache.org/viewcvs?rev=382175&view=rev
Log:
Added guard that compares column sizes during alteration only if the size matters for the
jdbc type and platform

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java?rev=382175&r1=382174&r2=382175&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java Wed Mar  1 14:15:24
2006
@@ -1364,16 +1364,14 @@
         String  desiredDefault = desiredColumn.getDefaultValue();
         String  currentDefault = currentColumn.getDefaultValue();
         boolean defaultsEqual  = (desiredDefault == null) || desiredDefault.equals(currentDefault);
-        boolean sizeMatters    = (desiredColumn.getSize() != null);
+        boolean sizeMatters    = getPlatformInfo().hasSize(currentColumn.getTypeCode());
 
         // We're comparing the jdbc type that corresponds to the native type for the
         // desired type, in order to avoid repeated altering of a perfectly valid column
         if ((getPlatformInfo().getTargetJdbcType(desiredColumn.getTypeCode()) != currentColumn.getTypeCode())
||
             (desiredColumn.isRequired() != currentColumn.isRequired()) ||
-            (sizeMatters && (!desiredColumn.getSize().equals(currentColumn.getSize())))
||
-            !defaultsEqual /*|| //determined these two to be hardly useful
-            (columnA.getScale() != columnB.getScale()) ||
-            (columnA.getPrecisionRadix() != columnB.getPrecisionRadix())*/ )
+            (sizeMatters && !StringUtils.equals(desiredColumn.getSize(), currentColumn.getSize()))
||
+            !defaultsEqual)
         {
             return true;
         }



Mime
View raw message