You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2006/04/21 19:25:41 UTC

svn commit: r395953 - in /db/torque: generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java site/trunk/xdocs/changes.xml

Author: tfischer
Date: Fri Apr 21 10:25:39 2006
New Revision: 395953

URL: http://svn.apache.org/viewcvs?rev=395953&view=rev
Log:
Changed the mapping of the torque type INTEGER to the SQL type INTEGER in mysql.
MEDIUMINT only has 24 bits and does not cover the full data range of java integers.
This change remained unnoticed when switching to the platform implementation in 3.2.
Thanks to Joerg Friedrich for reporting the error.

Modified:
    db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java
    db/torque/generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java
    db/torque/site/trunk/xdocs/changes.xml

Modified: db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java?rev=395953&r1=395952&r2=395953&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java (original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java Fri Apr 21 10:25:39 2006
@@ -42,7 +42,6 @@
     private void initialize()
     {
         setSchemaDomainMapping(new Domain(SchemaType.NUMERIC, "DECIMAL"));
-        setSchemaDomainMapping(new Domain(SchemaType.INTEGER, "MEDIUMINT"));
         setSchemaDomainMapping(new Domain(SchemaType.LONGVARCHAR, "MEDIUMTEXT"));
         setSchemaDomainMapping(new Domain(SchemaType.DATE, "DATETIME"));
         setSchemaDomainMapping(new Domain(SchemaType.BINARY, "BLOB"));

Modified: db/torque/generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java?rev=395953&r1=395952&r2=395953&view=diff
==============================================================================
--- db/torque/generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java (original)
+++ db/torque/generator/trunk/src/test/org/apache/torque/engine/database/model/DomainTest.java Fri Apr 21 10:25:39 2006
@@ -131,7 +131,7 @@
         Table table = db.getTable("native");
         Column col = table.getColumn("native_id");
         assertEquals("AUTO_INCREMENT", col.getAutoIncrementString());
-        assertEquals("native_id MEDIUMINT NOT NULL AUTO_INCREMENT", col.getSqlString());
+        assertEquals("native_id INTEGER NOT NULL AUTO_INCREMENT", col.getSqlString());
         col = table.getColumn("name");
         assertEquals("", col.getAutoIncrementString());
     }
@@ -141,7 +141,7 @@
         Table table = db.getTable("article");
         Column col = table.getColumn("article_id");
         assertEquals("", col.getAutoIncrementString());
-        assertEquals("article_id MEDIUMINT NOT NULL", col.getSqlString());
+        assertEquals("article_id INTEGER NOT NULL", col.getSqlString());
         col = table.getColumn("name");
         assertEquals("", col.getAutoIncrementString());
     }

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/db/torque/site/trunk/xdocs/changes.xml?rev=395953&r1=395952&r2=395953&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Fri Apr 21 10:25:39 2006
@@ -29,6 +29,12 @@
 
   <release version="3.2.1-dev" date="in SVN">
   
+    <action type="fix" dev="tfischer" issue="TORQUE-5">
+      Mapped the Torque type INTEGER to the SQL type INTEGER in Mysql.
+      (In Torque 3.2, this was changed unintentionally to MEDIUMINT.
+      MEDIUMINT does not cover the full data range of java integers.)
+      Thanks to Joerg Friedrich for reporting the error.
+    </action>
     <action type="add" dev="tfischer">
       Added a new convenience method, Transaction.begin(), 
       which is the same as Transaction.begin(Torque.getDefaultDb()).



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org