db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r523790 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
Date Thu, 29 Mar 2007 18:35:30 GMT
Author: mvdb
Date: Thu Mar 29 11:35:30 2007
New Revision: 523790

URL: http://svn.apache.org/viewvc?view=rev&rev=523790
Log:
Fix issue DDLUTILS-165. Thanx to Stefan Huber for spotting and testing this.

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

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java?view=diff&rev=523790&r1=523789&r2=523790
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
(original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
Thu Mar 29 11:35:30 2007
@@ -117,6 +117,20 @@
                     column.setTypeCode(Types.LONGVARCHAR);
                 }
             }
+            // fix issue DDLUTILS-165 as postgresql-8.2-504-jdbc3.jar seems to return Integer.MAX_VALUE
+            // on columns defined as TEXT.
+            else if (column.getSizeAsInt() == Integer.MAX_VALUE)
+            {
+                column.setSize(null);
+                if (column.getTypeCode() == Types.VARCHAR)
+                {
+                    column.setTypeCode(Types.LONGVARCHAR);
+                }
+                else if (column.getTypeCode() == Types.BINARY)
+                {
+                    column.setTypeCode(Types.LONGVARBINARY);
+                }
+            }
         }
 
         String defaultValue = column.getDefaultValue();



Mime
View raw message