openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtyle...@apache.org
Subject svn commit: r947144 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java
Date Fri, 21 May 2010 19:49:58 GMT
Author: mtylenda
Date: Fri May 21 19:49:58 2010
New Revision: 947144

URL: http://svn.apache.org/viewvc?rev=947144&view=rev
Log:
OPENJPA-1667: Fix incorrect column type for LOB streaming in MySQL.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java?rev=947144&r1=947143&r2=947144&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
Fri May 21 19:49:58 2010
@@ -460,7 +460,7 @@ public class MySQLDictionary
     @Override
     public String getTypeName(Column col) {
         if (col.getType() == Types.BLOB) {
-            if (col.getSize() == 0)   // unknown size
+            if (col.getSize() <= 0)   // unknown size
                 return blobTypeName;  // return old default of 64KB
             else if (col.getSize() <= 255)
                 return tinyBlobTypeName;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java?rev=947144&r1=947143&r2=947144&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java
Fri May 21 19:49:58 2010
@@ -48,6 +48,8 @@ import org.apache.openjpa.persistence.te
 
 public abstract class AbstractLobTest extends SingleEMFTestCase {
 
+    protected static boolean firstTestExecuted;
+
     protected List<Class<? extends DBDictionary>> supportedDatabases =
         new ArrayList<Class<? extends DBDictionary>>
             (Arrays.asList(MySQLDictionary.class, OracleDictionary.class, SQLServerDictionary.class));
@@ -58,7 +60,10 @@ public abstract class AbstractLobTest ex
             return;
         }
 
-        super.setUp(getLobEntityClass(), CLEAR_TABLES,
+        // Test CREATE TABLE but only once to save time.
+        Object clearOrDropTables = (firstTestExecuted) ? CLEAR_TABLES : DROP_TABLES;
+        firstTestExecuted = true;
+        super.setUp(getLobEntityClass(), clearOrDropTables,
             "openjpa.DataCache", "true",
             "openjpa.RemoteCommitProvider", "sjvm",
             "openjpa.ConnectionRetainMode", "transaction");



Mime
View raw message