empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r933396 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Date Mon, 12 Apr 2010 20:18:14 GMT
Author: francisdb
Date: Mon Apr 12 20:18:13 2010
New Revision: 933396

URL: http://svn.apache.org/viewvc?rev=933396&view=rev
Log:
EMPIREDB-76 erroneous translation of DataType.DOUBLE for postgres (patch by Andreas Fink)

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java?rev=933396&r1=933395&r2=933396&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Mon Apr 12 20:18:13 2010
@@ -353,7 +353,7 @@ public class DBDatabaseDriverPostgreSQL 
             case BOOL:     return "CAST(? AS BOOL)";
             case INTEGER:  return "CAST(? AS INTEGER)";
             case DECIMAL:  return "CAST(? AS DECIMAL)";
-            case DOUBLE:   return "CAST(? AS DECIMAL)";
+            case DOUBLE:   return "CAST(? AS DOUBLE PRECISION)";
             case DATE:     return "CAST(? AS DATE)";
             case DATETIME: return "CAST(? AS TIMESTAMP)";
                 // Convert to text
@@ -632,6 +632,8 @@ public class DBDatabaseDriverPostgreSQL 
     
     /**
      * Appends a table column definition to a ddl statement
+     * http://www.postgresql.org/docs/8.3/static/datatype.html
+     * 
      * @param c the column which description to append
      * @param sql the sql builder object
      * @param alter is this for an alter statement
@@ -701,7 +703,7 @@ public class DBDatabaseDriverPostgreSQL 
                 sql.append("BOOLEAN");
                 break;
             case DOUBLE:
-                sql.append("DOUBLE");
+                sql.append("DOUBLE PRECISION");
                 break;
             case DECIMAL:
             { // Decimal
@@ -719,7 +721,7 @@ public class DBDatabaseDriverPostgreSQL 
                 sql.append("TEXT");
                 break;
             case BLOB:
-                sql.append("bytea");
+                sql.append("BYTEA");
                 break;
             case UNIQUEID:
                 // emulate using java.util.UUID



Mime
View raw message