activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r985151 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
Date Fri, 13 Aug 2010 10:21:15 GMT
Author: gtully
Date: Fri Aug 13 10:21:15 2010
New Revision: 985151

URL: http://svn.apache.org/viewvc?rev=985151&view=rev
Log:
resolve https://issues.apache.org/activemq/browse/AMQ-2857 apply variant of patch to support
mysql 5.5 -introduce typeStatement default to ENGING can be set to TYPE, thanks

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java?rev=985151&r1=985150&r2=985151&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
Fri Aug 13 10:21:15 2010
@@ -40,6 +40,7 @@ public class MySqlJDBCAdapter extends De
     public static final String HEAP = "HEAP";
 
     String engineType = INNODB;
+    String typeStatement = "ENGINE";
 
     public void setStatements(Statements statements) {
         String type = engineType.toUpperCase();
@@ -51,17 +52,17 @@ public class MySqlJDBCAdapter extends De
         statements.setBinaryDataType("LONGBLOB");
         
         
-        String typeClause = " TYPE="+type;
+        String typeClause = typeStatement + "=" + type;
         if( type.equals(NDBCLUSTER) ) {
             // in the NDBCLUSTER case we will create as INNODB and then alter to NDBCLUSTER
-            typeClause = " TYPE="+INNODB;
+            typeClause = typeStatement + "=" + INNODB;
         }
         
         // Update the create statements so they use the right type of engine 
         String[] s = statements.getCreateSchemaStatements();
         for (int i = 0; i < s.length; i++) {
             if( s[i].startsWith("CREATE TABLE")) {
-                s[i] = s[i]+typeClause;
+                s[i] = s[i]+ " " + typeClause;
             }
         }
         
@@ -86,4 +87,12 @@ public class MySqlJDBCAdapter extends De
     public void setEngineType(String engineType) {
         this.engineType = engineType;
     }
+
+    public String getTypeStatement() {
+        return typeStatement;
+    }
+
+    public void setTypeStatement(String typeStatement) {
+        this.typeStatement = typeStatement;
+    }
 }



Mime
View raw message