diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java index 5cc803f885..a63cb5e08a 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java @@ -40,6 +40,7 @@ public class MySqlJDBCAdapter extends DefaultJDBCAdapter { 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 DefaultJDBCAdapter { 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 DefaultJDBCAdapter { public void setEngineType(String engineType) { this.engineType = engineType; } + + public String getTypeStatement() { + return typeStatement; + } + + public void setTypeStatement(String typeStatement) { + this.typeStatement = typeStatement; + } }